content large_stringlengths 3 20.5k | url large_stringlengths 54 193 | branch large_stringclasses 4
values | source large_stringclasses 42
values | embeddings listlengths 384 384 | score float64 -0.21 0.65 |
|---|---|---|---|---|---|
secret store or reference a correctly configured one the ability to read secrets. \*\*This approach is usually not recommended\*\*. But may make sense when you want to share an identity with multiple namespaces. Also see our [Multi-Tenancy Guide](../guides/multi-tenancy.md) for design considerations. ```yaml {% include 'azkv-workload-identity-mounted.yaml' %} ``` ##### Referenced Service Account You run the controller without service account (effectively without azure permissions). Now you have to configure the SecretStore and set the `serviceAccountRef` and point to the service account you have just created. \*\*This is usually the recommended approach\*\*. It makes sense for everyone who wants to run the controller without Azure permissions and delegate authentication via service accounts in particular namespaces. Also see our [Multi-Tenancy Guide](../guides/multi-tenancy.md) for design considerations. ```yaml {% include 'azkv-workload-identity.yaml' %} ``` In case you don't have the clientId when deploying the SecretStore, such as when deploying a Helm chart that includes instructions for creating a [Managed Identity](https://github.com/Azure/azure-service-operator/blob/main/v2/samples/managedidentity/v1api20181130/v1api20181130\_userassignedidentity.yaml) using [Azure Service Operator](https://azure.github.io/azure-service-operator/) next to the SecretStore definition, you may encounter an interpolation problem. Helm lacks dependency management, which means it can create an issue when the clientId is only known after everything is deployed. Although the Service Account can inject `clientId` and `tenantId` into a pod, it doesn't support secretKeyRef/configMapKeyRef. Therefore, you can deliver the clientId and tenantId directly, bypassing the Service Account. The following example demonstrates using the secretRef field to directly deliver the `clientId` and `tenantId` to the SecretStore while utilizing Workload Identity authentication. ```yaml {% include 'azkv-workload-identity-secretref.yaml' %} ``` ### Custom Cloud Configuration External Secrets Operator supports custom cloud endpoints for Azure Stack Hub, Azure Stack Edge, and other scenarios where the default cloud endpoints don't match your environment. This feature requires using the new Azure SDK. #### Azure China Workload Identity Azure China's AKS uses a different OIDC issuer (`login.partner.microsoftonline.cn`) than the standard China Cloud endpoint (`login.chinacloudapi.cn`). When using Workload Identity with AKS in Azure China, you need to override the Active Directory endpoint: ```yaml apiVersion: external-secrets.io/v1 kind: ClusterSecretStore metadata: name: azure-china-workload-identity spec: provider: azurekv: vaultUrl: "https://my-vault.vault.azure.cn" environmentType: ChinaCloud authType: WorkloadIdentity # REQUIRED: Must be true to use custom cloud configuration useAzureSDK: true # Override the Active Directory endpoint to match AKS OIDC issuer customCloudConfig: activeDirectoryEndpoint: "https://login.partner.microsoftonline.cn/" keyVaultEndpoint: "https://vault.azure.cn/" resourceManagerEndpoint: "https://management.chinacloudapi.cn/" serviceAccountRef: name: my-service-account namespace: default ``` #### Azure Stack Configuration For Azure Stack Hub or Azure Stack Edge environments: ```yaml apiVersion: external-secrets.io/v1beta1 kind: SecretStore metadata: name: azure-stack-backend spec: provider: azurekv: vaultUrl: "https://my-vault.vault.local.azurestack.external/" # REQUIRED: Must be set to AzureStackCloud for custom environments environmentType: AzureStackCloud # REQUIRED: Must be true for Azure Stack (legacy SDK doesn't support custom clouds) useAzureSDK: true # REQUIRED: Custom cloud endpoints for your Azure Stack deployment customCloudConfig: # Azure Active Directory endpoint for authentication activeDirectoryEndpoint: "https://login.microsoftonline.com/" # Optional: Key Vault endpoint if different from vaultUrl domain keyVaultEndpoint: "https://vault.local.azurestack.external/" # Optional: Resource Manager endpoint for resource operations resourceManagerEndpoint: "https://management.local.azurestack.external/" # ... rest of authentication configuration (Service Principal example) authType: ServicePrincipal tenantId: "your-tenant-id" authSecretRef: clientId: name: azure-secret key: client-id clientSecret: name: azure-secret key: client-secret ``` \*\*Important Notes:\*\* - `useAzureSDK: true` is mandatory when using `customCloudConfig` - `customCloudConfig` can be used with any `environmentType` (PublicCloud, ChinaCloud, etc.) - For AzureStackCloud, `customCloudConfig` is required - Contact your Azure Stack administrator for the correct endpoint URLs ### Update secret store Be sure the `azurekv` provider is listed in the `Kind=SecretStore` ```yaml {% include 'azkv-secret-store.yaml' %} ``` \*\*NOTE:\*\* In case of a `ClusterSecretStore`, Be sure to provide `namespace` in `clientId` and `clientSecret` with the namespaces where the secrets reside. Or in case of Managed Identity authentication: ```yaml {% include 'azkv-secret-store-mi.yaml' %} ``` ### Object Types Azure Key Vault manages different [object types](https://docs.microsoft.com/en-us/azure/key-vault/general/about-keys-secrets-certificates#object-types), we | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/azure-key-vault.md | main | external-secrets | [
-0.07703962922096252,
0.01995917037129402,
-0.10050699859857559,
0.011244785971939564,
-0.06133579462766647,
0.02852027676999569,
0.10782676190137863,
-0.05133524164557457,
0.10119541734457016,
0.10910617560148239,
0.04352430999279022,
-0.032012924551963806,
0.14577294886112213,
0.05001136... | -0.059757 |
include 'azkv-secret-store.yaml' %} ``` \*\*NOTE:\*\* In case of a `ClusterSecretStore`, Be sure to provide `namespace` in `clientId` and `clientSecret` with the namespaces where the secrets reside. Or in case of Managed Identity authentication: ```yaml {% include 'azkv-secret-store-mi.yaml' %} ``` ### Object Types Azure Key Vault manages different [object types](https://docs.microsoft.com/en-us/azure/key-vault/general/about-keys-secrets-certificates#object-types), we support `keys`, `secrets` and `certificates`. Simply prefix the key with `key`, `secret` or `cert` to retrieve the desired type (defaults to secret). | Object Type | Return Value | | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `secret` | the raw secret value. | | `key` | A JWK which contains the public key. Azure Key Vault does \*\*not\*\* export the private key. You may want to use [template functions](../guides/templating.md) to transform this JWK into PEM encoded PKIX ASN.1 DER format. | | `certificate` | The raw CER contents of the x509 certificate. You may want to use [template functions](../guides/templating.md) to transform this into your desired encoding | ### Creating external secret To create a Kubernetes secret from the Azure Key vault secret a `Kind=ExternalSecret` is needed. You can manage keys/secrets/certificates saved inside the keyvault , by setting a "/" prefixed type in the secret name, the default type is a `secret`. Other supported values are `cert` and `key`. ```yaml {% include 'azkv-external-secret.yaml' %} ``` The operator will fetch the Azure Key vault secret and inject it as a `Kind=Secret`. Then the Kubernetes secret can be fetched by issuing: ```sh kubectl get secret secret-to-be-created -n -o jsonpath='{.data.dev-secret-test}' | base64 -d ``` To select all secrets inside the key vault or all tags inside a secret, you can use the `dataFrom` directive: ```yaml {% include 'azkv-datafrom-external-secret.yaml' %} ``` To get a PKCS#12 certificate from Azure Key Vault and inject it as a `Kind=Secret` of type `kubernetes.io/tls`: ```yaml {% include 'azkv-pkcs12-cert-external-secret.yaml' %} ``` ### Creating a PushSecret You can push secrets to Azure Key Vault into the different `secret`, `key` and `certificate` APIs. #### Pushing to a Secret Pushing to a Secret requires no previous setup. with the secret available in Kubernetes, you can simply refer it to a PushSecret object to have it created on Azure Key Vault: ```yaml {% include 'azkv-pushsecret-secret.yaml' %} ``` !!! note In order to create a PushSecret targeting keys, `CreateSecret` and `DeleteSecret` actions must be granted to the Service Principal/Identity configured on the SecretStore. #### Pushing to a Key The first step is to generate a valid Private Key. Supported Formats include `PRIVATE KEY`, `RSA PRIVATE KEY` AND `EC PRIVATE KEY` (EC/PKCS1/PKCS8 types). After uploading your key to a Kubernetes Secret, the next step is to create a PushSecret manifest with the following configuration: ```yaml {% include 'azkv-pushsecret-key.yaml' %} ``` !!! note In order to create a PushSecret targeting keys, `ImportKey` and `DeleteKey` actions must be granted to the Service Principal/Identity configured on the SecretStore. #### Pushing to a Certificate The first step is to generate a valid P12 certificate. Currently, only PKCS1/PKCS8 types are supported. Currently only password-less P12 certificates are supported. After uploading your P12 certificate to a Kubernetes Secret, the next step is to create a PushSecret manifest with the following configuration ```yaml {% include 'azkv-pushsecret-certificate.yaml' %} ``` !!! note In order to create a PushSecret targeting keys, `ImportCertificate` and `DeleteCertificate` actions must be granted to the Service Principal/Identity configured on the SecretStore. | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/azure-key-vault.md | main | external-secrets | [
0.0014617692213505507,
0.0660601481795311,
-0.08267350494861603,
0.06352327764034271,
-0.04674793779850006,
-0.0014704713830724359,
0.036658406257629395,
-0.021761111915111542,
0.09576508402824402,
0.08203010261058807,
0.02441767044365406,
-0.03611115366220474,
0.1282832771539688,
0.053058... | -0.057047 |
External Secrets Operator allows to retrieve secrets from a Kubernetes Cluster - this can be either a remote cluster or the local one where the operator runs in. A `SecretStore` points to a \*\*specific namespace\*\* in the target Kubernetes Cluster. You are able to retrieve all secrets from that particular namespace given you have the correct set of RBAC permissions. The `SecretStore` reconciler checks if you have read access for secrets in that namespace using `SelfSubjectRulesReview` and will fallback to `SelfSubjectAccessReview` when that fails. See below on how to set that up properly. ### External Secret Spec This provider supports the use of the `Property` field. With it you point to the key of the remote secret. If you leave it empty it will json encode all key/value pairs. ```yaml apiVersion: external-secrets.io/v1 kind: ExternalSecret metadata: name: database-credentials spec: refreshInterval: 1h0m0s secretStoreRef: kind: SecretStore name: k8s-store # name of the SecretStore (or kind specified) target: name: database-credentials # name of the k8s Secret to be created data: - secretKey: username remoteRef: key: database-credentials property: username - secretKey: password remoteRef: key: database-credentials property: password # metadataPolicy to fetch all the labels and annotations in JSON format - secretKey: tags remoteRef: metadataPolicy: Fetch key: database-credentials # metadataPolicy to fetch all the labels in JSON format - secretKey: labels remoteRef: metadataPolicy: Fetch key: database-credentials property: labels # metadataPolicy to fetch a specific label (dev) from the source secret - secretKey: developer remoteRef: metadataPolicy: Fetch key: database-credentials property: labels.dev ``` #### find by tag & name You can fetch secrets based on labels or names matching a regexp: ```yaml apiVersion: external-secrets.io/v1 kind: ExternalSecret metadata: name: fetch-tls-and-nginx spec: refreshInterval: 1h0m0s secretStoreRef: kind: SecretStore name: k8s-store target: name: fetch-tls-and-nginx dataFrom: - find: name: # match secret name with regexp regexp: "tls-.\*" - find: tags: # fetch secrets based on label combination app: "nginx" ``` ### Target API-Server Configuration The servers `url` can be omitted and defaults to `kubernetes.default`. You \*\*have to\*\* provide a CA certificate in order to connect to the API Server securely. For your convenience, each namespace has a ConfigMap `kube-root-ca.crt` that contains the CA certificate of the internal API Server (see `RootCAConfigMap` [feature gate](https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/)). Use that if you want to connect to the same API server. If you want to connect to a remote API Server you need to fetch it and store it inside the cluster as ConfigMap or Secret. You may also define it inline as base64 encoded value using the `caBundle` property. ```yaml apiVersion: external-secrets.io/v1 kind: SecretStore metadata: name: k8s-store-default-ns spec: provider: kubernetes: # with this, the store is able to pull only from `default` namespace remoteNamespace: default server: url: "https://myapiserver.tld" caProvider: type: ConfigMap name: kube-root-ca.crt key: ca.crt ``` ### Authentication It's possible to authenticate against the Kubernetes API using client certificates, a bearer token or service account. The operator enforces that exactly one authentication method is used. You can not use the service account that is mounted inside the operator, this is by design to avoid reading secrets across namespaces. \*\*NOTE:\*\* `SelfSubjectRulesReview` permission is required in order to validation work properly. Please use the following role as reference: ```yaml apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: namespace: default name: eso-store-role rules: - apiGroups: [""] resources: - secrets verbs: - get - list - watch - apiGroups: - authorization.k8s.io resources: - selfsubjectrulesreviews verbs: - create ``` #### Authenticating with BearerToken Create a Kubernetes secret with a client token. There are many ways to acquire such a token, please refer to the [Kubernetes Authentication docs](https://kubernetes.io/docs/reference/access-authn-authz/authentication/#authentication-strategies). ```yaml apiVersion: v1 kind: Secret metadata: name: my-token data: token: "...." ``` Create a SecretStore: The `auth` section indicates | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/kubernetes.md | main | external-secrets | [
-0.06885337829589844,
-0.043289557099342346,
-0.01768486388027668,
0.04933002218604088,
-0.0441657230257988,
-0.010231790132820606,
-0.0023912324104458094,
-0.015762168914079666,
0.06500045210123062,
0.023094553500413895,
-0.013814860954880714,
-0.05480925366282463,
0.011878905817866325,
-... | 0.086687 |
- create ``` #### Authenticating with BearerToken Create a Kubernetes secret with a client token. There are many ways to acquire such a token, please refer to the [Kubernetes Authentication docs](https://kubernetes.io/docs/reference/access-authn-authz/authentication/#authentication-strategies). ```yaml apiVersion: v1 kind: Secret metadata: name: my-token data: token: "...." ``` Create a SecretStore: The `auth` section indicates that the type `token` will be used for authentication, it includes the path to fetch the token. Set `remoteNamespace` to the name of the namespace where your target secrets reside. ```yaml apiVersion: external-secrets.io/v1 kind: SecretStore metadata: name: k8s-store-token-auth spec: provider: kubernetes: # with this, the store is able to pull only from `default` namespace remoteNamespace: default server: # ... auth: token: bearerToken: name: my-token key: token ``` #### Authenticating with ServiceAccount Create a Kubernetes Service Account, please refer to the [Service Account Tokens Documentation](https://kubernetes.io/docs/reference/access-authn-authz/authentication/#service-account-tokens) on how they work and how to create them. ``` $ kubectl create serviceaccount my-store ``` This Service Account needs permissions to read `Secret` and create `SelfSubjectRulesReview` resources. Please see the above role. ``` $ kubectl create rolebinding my-store --role=eso-store-role --serviceaccount=default:my-store ``` Create a SecretStore: the `auth` section indicates that the type `serviceAccount` will be used for authentication. ```yaml apiVersion: external-secrets.io/v1 kind: SecretStore metadata: name: k8s-store-sa-auth spec: provider: kubernetes: # with this, the store is able to pull only from `default` namespace remoteNamespace: default server: # ... auth: serviceAccount: name: "my-store" ``` #### Authenticating with Client Certificates Create a Kubernetes secret which contains the client key and certificate. See [Generate Certificates Documentations](https://kubernetes.io/docs/tasks/administer-cluster/certificates/) on how to create them. ``` $ kubectl create secret tls tls-secret --cert=path/to/tls.cert --key=path/to/tls.key ``` Reference the `tls-secret` in the SecretStore ```yaml apiVersion: external-secrets.io/v1 kind: SecretStore metadata: name: k8s-store-cert-auth spec: provider: kubernetes: # with this, the store is able to pull only from `default` namespace remoteNamespace: default server: # ... auth: cert: clientCert: name: "tls-secret" key: "tls.crt" clientKey: name: "tls-secret" key: "tls.key" ``` ### Access from different namespace in same cluster If you don't have cluster wide access to create a `ClusterExternalSecret`, you can still access a secret from a dedicated namespace via a bearer token to a service connection within that namespace: ```YAML # shared-secrets.yaml apiVersion: v1 kind: Secret metadata: name: user-credentials namespace: shared-secrets type: Opaque stringData: username: peter --- apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: eso-store-role namespace: shared-secrets rules: - apiGroups: [""] resources: - secrets verbs: - get - list - watch # This will allow the role `eso-store-role` to perform \*\*permission reviews\*\* for itself within the defined namespace: - apiGroups: - authorization.k8s.io resources: - selfsubjectrulesreviews # used to review or fetch the list of permissions a user or service account currently has. verbs: - create # `create` allows creating a `selfsubjectrulesreviews` request. --- apiVersion: v1 kind: ServiceAccount metadata: name: eso-service-account namespace: shared-secrets --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: bind-eso-store-role-to-eso-service-account namespace: shared-secrets subjects: - kind: ServiceAccount name: eso-service-account namespace: shared-secrets roleRef: kind: Role name: eso-store-role apiGroup: rbac.authorization.k8s.io ``` After `kubectl apply -f shared-secrets.yaml`, create a bearer token for the service account with `kubectl create token eso-service-account`, then use that bearer token to access the `remoteNamespace` via secret in the target namespace: ```YAML apiVersion: v1 kind: Secret metadata: name: eso-token namespace: target-namespace stringData: token: "" --- apiVersion: external-secrets.io/v1 kind: SecretStore metadata: name: kubernetes-secret-store namespace: target-namespace spec: provider: kubernetes: remoteNamespace: shared-secrets server: # Skip url cause we are in the same cluster caProvider: type: ConfigMap name: kube-root-ca.crt key: ca.crt auth: token: bearerToken: name: eso-token key: token --- apiVersion: external-secrets.io/v1 kind: ExternalSecret metadata: name: eso-kubernetes-secret namespace: target-namespace spec: secretStoreRef: kind: SecretStore name: kubernetes-secret-store target: name: eso-kubernetes-secret data: - secretKey: username remoteRef: key: user-credentials property: username ``` ### PushSecret The PushSecret functionality facilitates the replication | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/kubernetes.md | main | external-secrets | [
-0.06713758409023285,
0.011916385032236576,
0.014421731233596802,
0.03266393020749092,
-0.06302456557750702,
0.025616375729441643,
0.013376273214817047,
0.0650775358080864,
0.07853546738624573,
0.06088196486234665,
-0.02789853699505329,
-0.053898125886917114,
0.012919844128191471,
-0.00682... | 0.078638 |
type: ConfigMap name: kube-root-ca.crt key: ca.crt auth: token: bearerToken: name: eso-token key: token --- apiVersion: external-secrets.io/v1 kind: ExternalSecret metadata: name: eso-kubernetes-secret namespace: target-namespace spec: secretStoreRef: kind: SecretStore name: kubernetes-secret-store target: name: eso-kubernetes-secret data: - secretKey: username remoteRef: key: user-credentials property: username ``` ### PushSecret The PushSecret functionality facilitates the replication of a Kubernetes Secret from one namespace or cluster to another. This feature proves useful in scenarios where you need to share sensitive information, such as credentials or configuration data, across different parts of your infrastructure. To configure the PushSecret resource, you need to specify the following parameters: \* \*\*Selector\*\*: Specify the selector that identifies the source Secret to be replicated. This selector allows you to target the specific Secret you want to share. \* \*\*SecretKey\*\*: Set the SecretKey parameter to indicate the key within the source Secret that you want to replicate. This ensures that only the relevant information is shared. \* \*\*RemoteRef.Property\*\*: In addition to the above parameters, the Kubernetes provider requires you to set the `remoteRef.property` field. This field specifies the key of the remote Secret resource where the replicated value should be stored. Here's an example: ```yaml apiVersion: external-secrets.io/v1alpha1 kind: PushSecret metadata: name: example spec: refreshInterval: 1h0m0s secretStoreRefs: - name: k8s-store-remote-ns kind: SecretStore selector: secret: name: pokedex-credentials data: - match: secretKey: best-pokemon remoteRef: remoteKey: remote-best-pokemon property: best-pokemon ``` To use the PushSecret feature effectively, the referenced `SecretStore` requires specific permissions on the target cluster. In particular, it requires `create`, `read`, `update` and `delete` permissions on the Secret resource: ```yaml apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: namespace: remote name: eso-store-push-role rules: - apiGroups: [""] resources: - secrets verbs: - get - list - watch - create - update - patch - delete - apiGroups: - authorization.k8s.io resources: - selfsubjectrulesreviews verbs: - create ``` It is possible to override the target secret type with the `.template.type` property. By default the secret type is copied from the source secret. If none is specified, the default type `Opaque` will be used. The type can be set to any valid Kubernetes secret type, such as `kubernetes.io/dockerconfigjson`, `kubernetes.io/tls`, etc. ```yaml apiVersion: external-secrets.io/v1alpha1 kind: PushSecret metadata: name: example spec: refreshInterval: 1h0m0s secretStoreRefs: - name: k8s-store-remote-ns kind: SecretStore selector: secret: name: pokedex-credentials template: type: kubernetes.io/dockerconfigjson data: - match: secretKey: dockerconfigjson remoteRef: remoteKey: remote-dockerconfigjson property: ".dockerconfigjson" ``` #### PushSecret Metadata The Kubernetes provider is able to manage both `metadata.labels` and `metadata.annotations` of the secret on the target cluster. Users have different preferences on what metadata should be pushed. ESO, by default, pushes both labels and annotations to the target secret and merges them with the existing metadata. You can specify the metadata in the `spec.template.metadata` section if you want to decouple it from the existing secret. ```yaml {% raw %} apiVersion: external-secrets.io/v1alpha1 kind: PushSecret metadata: name: example spec: # ... template: metadata: labels: app.kubernetes.io/part-of: argocd data: mysql\_connection\_string: "mysql://{{ .hostname }}:3306/{{ .database }}" data: - match: secretKey: mysql\_connection\_string remoteRef: remoteKey: backend\_secrets property: mysql\_connection\_string {% endraw %} ``` Further, you can leverage the `.data[].metadata` section to fine-tine the behavior of the metadata merge strategy. The metadata section is a versioned custom-resource \_similar\_ structure, the behavior is detailed below. ```yaml apiVersion: external-secrets.io/v1alpha1 kind: PushSecret metadata: name: example spec: # ... data: - match: secretKey: example-1 remoteRef: remoteKey: example-remote-secret property: url metadata: apiVersion: kubernetes.external-secrets.io/v1alpha1 kind: PushSecretMetadata spec: sourceMergePolicy: Merge # or Replace targetMergePolicy: Merge # or Replace / Ignore labels: color: red annotations: yes: please ``` | Field | Type | Description | |-------------------|--------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | sourceMergePolicy | string: `Merge`, `Replace` | The sourceMergePolicy defines how the metadata of the source secret is merged. `Merge` will merge the metadata of the | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/kubernetes.md | main | external-secrets | [
-0.03584316000342369,
-0.06284230202436447,
0.00864290352910757,
0.0021499863360077143,
-0.007576370146125555,
-0.01543426513671875,
0.012535491026937962,
0.06473403424024582,
0.0831756666302681,
0.04478985443711281,
-0.014773494563996792,
-0.12306486815214157,
0.019662700593471527,
0.0003... | 0.143643 |
or Replace targetMergePolicy: Merge # or Replace / Ignore labels: color: red annotations: yes: please ``` | Field | Type | Description | |-------------------|--------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | sourceMergePolicy | string: `Merge`, `Replace` | The sourceMergePolicy defines how the metadata of the source secret is merged. `Merge` will merge the metadata of the source secret with the metadata defined in `.data[].metadata`. With `Replace`, the metadata in `.data[].metadata` replaces the source metadata. | | targetMergePolicy | string: `Merge`, `Replace`, `Ignore` | The targetMergePolicy defines how ESO merges the metadata produced by the sourceMergePolicy with the target secret. With `Merge`, the source metadata is merged with the existing metadata from the target secret. `Replace` will replace the target metadata with the metadata defined in the source. `Ignore` leaves the target metadata as is. | | labels | `map[string]string` | The labels. | | annotations | `map[string]string` | The annotations. | | remoteNamespace | string | The Namespace in which the remote Secret will created in if defined. | #### Implementation Considerations When using the PushSecret feature and configuring the permissions for the SecretStore, consider the following: \* \*\*RBAC Configuration\*\*: Ensure that the Role-Based Access Control (RBAC) configuration for the SecretStore grants the appropriate permissions for creating, reading, and updating resources in the target cluster. \* \*\*Least Privilege Principle\*\*: Adhere to the principle of least privilege when assigning permissions to the SecretStore. Only provide the minimum required permissions to accomplish the desired synchronization between Secrets. \* \*\*Namespace or Cluster Scope\*\*: Depending on your specific requirements, configure the SecretStore to operate at the desired scope, whether it is limited to a specific namespace or encompasses the entire cluster. Consider the security and access control implications of your chosen scope. | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/kubernetes.md | main | external-secrets | [
0.008132651448249817,
0.054942697286605835,
0.05757516250014305,
0.03457856550812721,
0.05357111617922783,
0.06253889948129654,
0.058291174471378326,
-0.007685644552111626,
0.03288649395108223,
-0.07981129735708237,
0.004614124074578285,
-0.07277259230613708,
0.004300317727029324,
-0.04551... | 0.04572 |
## 1Password Secrets Automation External Secrets Operator integrates with [1Password Secrets Automation](https://1password.com/products/secrets/) for secret management. ## Deprecation Consider using [1Password SDK provider](1password-sdk.md) instead. It uses an official [SDK for 1Password](https://developer.1password.com/docs/sdks) created by 1Password. It's feature complete and has parity with this provider's capabilities. ### Important note about this documentation \_\*\*The 1Password API calls the entries in vaults 'Items'. These docs use the same term.\*\*\_ ### Behavior \* How an Item is equated to an ExternalSecret: \* `remoteRef.key` is equated to an Item's Title \* `remoteRef.property` is equated to: \* An Item's field's Label (Password type) \* An Item's file's Name (Document type) \* If empty, defaults to the first file name, or the field labeled `password` \* `remoteRef.version` is currently not supported. \* One Item in a vault can equate to one Kubernetes Secret to keep things easy to comprehend. \* Support for 1Password secret types of `Password` and `Document`. \* The `Password` type can get data from multiple `fields` in the Item. \* The `Document` type can get data from files. \* See [creating 1Password Items compatible with ExternalSecrets](#creating-compatible-1password-items). \* Ordered vaults \* Specify an ordered list of vaults in a SecretStore and the value will be sourced from the first vault with a matching Item. \* If no matching Item is found, an error is returned. \* This supports having a default or shared set of values that can also be overridden for specific environments. \* `dataFrom`: \* `find.path` is equated to Item Title. \* `find.name.regexp` is equated to field Labels. \* `find.tags` fetches for Items with the same tags matching the keys of `find.tags`. ### Prerequisites \* 1Password requires running a 1Password Connect Server to which the API requests will be made. \* External Secrets does not run this server. See [Deploy a Connect Server](#deploy-a-connect-server). \* One Connect Server is needed per 1Password Automation Environment. \* Many Vaults can be added to an Automation Environment, and Tokens can be generated in that Environment with access to any set or subset of those Vaults. \* 1Password Connect Server version 1.5.6 or higher. ### Setup Authentication \_Authentication requires a `1password-credentials.json` file provided to the Connect Server, and a related 'Access Token' for the client in this provider to authenticate to that Connect Server. Both of these are generated by 1Password.\_ 1. Setup an Automation Environment [at 1Password.com](https://support.1password.com/secrets-automation/), or [via the op CLI](https://github.com/1Password/connect/blob/a0a5f3d92e68497098d9314721335a7bb68a3b2d/README.md#create-server-and-access-token). \* Note: don't be confused by the `op connect server create` syntax. This will create an Automation Environment in 1Password, and corresponding credentials for a Connect Server, nothing more. \* This will result in a `1password-credentials.json` file to provide to a Connect Server Deployment, and an Access Token to provide as a Secret referenced by a `SecretStore` or `ClusterSecretStore`. 1. Create a Kubernetes secret with the Access Token ```yaml {% include '1password-token-secret.yaml' %} ``` 1. Reference the secret in a SecretStore or ClusterSecretStore ```yaml {% include '1password-secret-store.yaml' %} ``` 1. Create a Kubernetes secret with the Connect Server credentials ```yaml {% include '1password-connect-server-secret.yaml' %} ``` 1. Reference the secret in a Connect Server Deployment ```yaml {% include '1password-connect-server-deployment.yaml' %} ``` ### Deploy a Connect Server \* Follow the remaining instructions in the [Quick Start guide](https://github.com/1Password/connect/blob/a0a5f3d92e68497098d9314721335a7bb68a3b2d/README.md#quick-start). \* Deploy at minimum a Deployment and Service for a Connect Server, to go along with the Secret for the Server created in the [Setup Authentication section](#setup-authentication). \* The Service's name will be referenced in SecretStores/ClusterSecretStores. \* Keep in mind the likely need for additional Connect Servers for other Automation Environments when naming objects. For example dev, staging, prod, etc. \* Unencrypted secret values are passed over the connection between the Operator | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/1password-automation.md | main | external-secrets | [
-0.0755777657032013,
-0.026843765750527382,
-0.043943166732788086,
-0.004476873204112053,
-0.018223753198981285,
-0.05097762122750282,
0.057092513889074326,
0.022681832313537598,
0.009405103512108326,
0.009774381294846535,
-0.016818447038531303,
-0.017442626878619194,
0.11969989538192749,
... | 0.041076 |
in the [Setup Authentication section](#setup-authentication). \* The Service's name will be referenced in SecretStores/ClusterSecretStores. \* Keep in mind the likely need for additional Connect Servers for other Automation Environments when naming objects. For example dev, staging, prod, etc. \* Unencrypted secret values are passed over the connection between the Operator and the Connect Server. \*\*Encrypting the connection is recommended.\*\* ### Creating Compatible 1Password Items \_Also see [examples below](#examples) for matching SecretStore and ExternalSecret specs.\_ #### Manually (Password type) 1. Click the plus button to create a new Password type Item. 1. Change the title to what you want `remoteRef.key` to be. 1. Set what you want `remoteRef.property` to be in the field sections where is says 'label', and values where it says 'new field'. 1. Click the 'Save' button.  #### Manually (Document type) \* Click the plus button to create a new Document type Item. \* Choose the file to upload and upload it. \* Change the title to match `remoteRef.key` \* Click the 'Add New File' button to add more files. \* Click the 'Save' button.  #### Scripting (Password type with op [CLI](https://developer.1password.com/docs/cli/v1/get-started/)) \* Create `file.json` with the following contents, swapping in your keys and values. Note: `section.name`'s and `section.title`'s values are ignored by the Operator, but cannot be empty for the `op` CLI ```json { "title": "my-title", "vault": { "id": "vault-id" }, "category": "LOGIN", "fields": [ { "id": "username", "type": "STRING", "purpose": "USERNAME", "label": "username", "value": "a-username" }, { "id": "password", "type": "CONCEALED", "purpose": "PASSWORD", "label": "password", "password\_details": { "strength": "TERRIBLE" }, "value": "a-password" }, { "id": "notesPlain", "type": "STRING", "purpose": "NOTES", "label": "notesPlain", "value": "notesPlain" }, { "id": "customField", "type": "CONCEALED", "purpose": "custom", "label": "custom", "value": "custom-value" } ] } ``` \* Run `op item create --template file.json` #### Scripting (Document type) \* Unfortunately the `op` CLI doesn't seem to support uploading multiple files to the same Item, and the current Go lib has a [bug](https://github.com/1Password/connect-sdk-go/issues/45). `op` can be used to create a Document type Item with one file in it, but for now it's necessary to add multiple files to the same Document via the GUI. #### In-built field labeled `password` on Password type Items \* TL;DR if you need a field labeled `password`, use the in-built one rather than the one in a fields Section.  \* 1Password automatically adds a field labeled `password` on every Password type Item, whether it's created through a GUI or the API or `op` CLI. \* There's no problem with using this field just like any other field, \_just make sure you don't end up with two fields with the same label\_. (For example, by automating the `op` CLI to create Items.) \* The in-built `password` field is not otherwise special for the purposes of ExternalSecrets. It can be ignored when not in use. ### Examples Examples of using the `my-env-config` and `my-cert` Items [seen above](#manually-password-type). \* Note: with this configuration a 1Password Item titled `my-env-config` is correlated to a ExternalSecret named `my-env-config` that results in a Kubernetes secret named `my-env-config`, all with matching names for the key/value pairs. This is a way to increase comprehensibility. ```yaml {% include '1password-secret-store.yaml' %} ``` ```yaml {% include '1password-external-secret-my-env-config.yaml' %} ``` ```yaml {% include '1password-external-secret-my-cert.yaml' %} ``` ### Additional Notes #### General \* It's intuitive to use Document type Items for Kubernetes secrets mounted as files, and Password type Items for ones that will be mounted as environment variables, but either can be used for either. It comes down to what's more convenient. #### Why no version history \* 1Password only supports version history on their in-built `password` field. Therefore, | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/1password-automation.md | main | external-secrets | [
-0.04140621796250343,
-0.08559355139732361,
-0.07969137281179428,
0.013811795972287655,
-0.075495146214962,
0.04469800740480423,
0.011757912114262581,
0.049377184361219406,
0.02168622426688671,
0.06343697756528854,
-0.029233794659376144,
-0.050543371587991714,
0.10927042365074158,
0.024858... | -0.015373 |
for Kubernetes secrets mounted as files, and Password type Items for ones that will be mounted as environment variables, but either can be used for either. It comes down to what's more convenient. #### Why no version history \* 1Password only supports version history on their in-built `password` field. Therefore, implementing version history in this provider would require one Item in 1Password per `remoteRef` in an ExternalSecret. Additionally `remoteRef.property` would be pointless/unusable. \* For example, a Kubernetes secret with 15 keys (say, used in `envFrom`,) would require 15 Items in the 1Password vault, instead of 15 Fields in 1 Item. This would quickly get untenable for more than a few secrets, because: \* All Items would have to have unique names which means `secretKey` couldn't match the Item name the `remoteRef` is targeting. \* Maintenance, particularly clean up of no longer used secrets, would be significantly more work. \* A vault would often become a huge list of unorganized entries as opposed to a much smaller list organized by Kubernetes Secret. \* To support new and old versions of a secret value at the same time, create a new Item in 1Password with the new value, and point some ExternalSecrets at a time to the new Item. #### Keeping misconfiguration from working \* One instance of the ExternalSecrets Operator \_can\_ work with many Connect Server instances, but it may not be the best approach. \* With one Operator instance per Connect Server instance, namespaces and RBAC can be used to improve security posture, and perhaps just as importantly, it's harder to misconfigure something and have it work (supply env A's secret values to env B for example.) \* You can run as many 1Password Connect Servers as you need security boundaries to help protect against accidental misconfiguration. #### Patching ExternalSecrets with Kustomize \* An overlay can provide a SecretStore specific to that overlay, and then use JSON6902 to patch all the ExternalSecrets coming from base to point to that SecretStore. Here's an example `overlays/staging/kustomization.yaml`: ```yaml --- apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - ../../base/something-with-external-secrets - secretStore.staging.yaml patchesJson6902: - target: kind: ExternalSecret name: ".\*" patch: |- - op: replace path: /spec/secretStoreRef/name value: staging ``` ### Push Secret To push a secret from Kubernetes cluster and create it as a secret in 1Password, a `Kind=PushSecret` resource is needed. Updating the vault on an existing PushSecret is currently not supported. To update the vault, create a new PushSecret with the updated vault. ```yaml {% include '1password-push-secret.yaml' %} ``` Then it will create an item in onepassword `op://staging/1pw-secret-name/password` equal to `my-secret`. | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/1password-automation.md | main | external-secrets | [
-0.03180506452918053,
-0.009912161156535149,
0.037695951759815216,
-0.04893830791115761,
-0.0034191750455647707,
0.029376164078712463,
-0.010690410621464252,
-0.028003353625535965,
0.0749083012342453,
0.06656251847743988,
-0.022940294817090034,
-0.014799945056438446,
0.057658515870571136,
... | 0.041598 |
## Delinea DevOps Secrets Vault External Secrets Operator integrates with [Delinea DevOps Secrets Vault](https://docs.delinea.com/online-help/products/devops-secrets-vault/current). Please note that the [Delinea Secret Server](https://delinea.com/products/secret-server) product is NOT in scope of this integration. ### Creating a SecretStore You need client ID, client secret and tenant to authenticate with DSV. Both client ID and client secret can be specified either directly in the config, or by referencing a kubernetes secret. To acquire client ID and client secret, refer to the [policy management](https://docs.delinea.com/dsv/current/tutorials/policy.md) and [client management](https://docs.delinea.com/dsv/current/usage/cli-ref/client.md) documentation. ```yaml apiVersion: external-secrets.io/v1 kind: SecretStore metadata: name: secret-store spec: provider: delinea: tenant: tld: clientId: value: clientSecret: secretRef: name: key: ``` Both `clientId` and `clientSecret` can either be specified directly via the `value` field or can reference a kubernetes secret. The `tenant` field must correspond to the host name / site name of your DevOps vault. If you selected a region other than the US you must also specify the TLD, e.g. `tld: eu`. If required, the URL template (`urlTemplate`) can be customized as well. ### Referencing Secrets Secrets can be referenced by path. Getting a specific version of a secret is not yet supported. Note that because all DSV secrets are JSON objects, you must specify `remoteRef.property`. You can access nested values or arrays using [gjson syntax](https://github.com/tidwall/gjson/blob/master/SYNTAX.md). ```yaml apiVersion: external-secrets.io/v1 kind: ExternalSecret metadata: name: secret spec: refreshInterval: 1h0m0s secretStoreRef: kind: SecretStore name: secret-store data: - secretKey: remoteRef: key: property: ``` | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/delinea.md | main | external-secrets | [
-0.08284635841846466,
-0.0024864685256034136,
-0.014854981563985348,
-0.08940016478300095,
-0.05173962563276291,
-0.038678739219903946,
0.020661290735006332,
0.019587237387895584,
0.11356710642576218,
-0.00341240712441504,
-0.014973463490605354,
-0.0450739748775959,
-0.0038672725204378366,
... | 0.055385 |
## Segura® DevOps Secret Manager (DSM) External Secrets Operator integrates with [Segura®](https://segura.security/) [DevOps Secret Manager (DSM)](https://segura.security/solutions/devops) module to sync application secrets to secrets held on the Kubernetes cluster. --- ## Authentication Authentication in Segura® uses DevOps Secret Manager (DSM) application authorization schema. Instructions to setup Authorizations and Secrets in Segura® DSM can be found at [Segura docs for DSM](https://docs.senhasegura.io/docs/how-to-manage-authorizations-per-application-in-devops-secret-manager). You will need to create an Kubernetes Secret with desired auth parameters, for example: ```yaml {% include 'senhasegura-dsm-secret.yaml' %} ``` --- ## Examples To sync secrets between Segura® DSM and Kubernetes with External Secrets, you need to define a SecretStore or ClusterSecretStore resource with Segura® provider, setting up authentication in the DSM module with the Secret you defined before. ### SecretStore ``` yaml {% include 'senhasegura-dsm-secretstore.yaml' %} ``` ### ClusterSecretStore ``` yaml {% include 'senhasegura-dsm-clustersecretstore.yaml' %} ``` --- ## Syncing secrets In examples below, consider that three secrets (api-settings, db-settings and hsm-settings) are defined in Segura® DSM --- \*\*Secret Identifier: \*\* api-settings \*\*Secret data:\*\* ```bash URL=https://example.com/api/example TOKEN=example-token-value ``` --- \*\*Secret Identifier: \*\* db-settings \*\*Secret data:\*\* ```bash DB\_HOST='db.example' DB\_PORT='5432' DB\_USERNAME='example' DB\_PASSWORD='example' ``` --- \*\*Secret Identifier: \*\* hsm-settings \*\*Secret data:\*\* ```bash HSM\_ADDRESS='hsm.example' HSM\_PORT='9223' ``` --- ### Sync DSM secrets using Secret Identifiers You can fetch all key/value pairs for a given secret identifier if you leave the remoteRef.property empty. This returns the json-encoded secret value for that path. If you only need a specific key, you can select it using remoteRef.property as the key name. In this method, you can overwrites data name in Kubernetes Secret object (e.g API\_SETTINGS and API\_SETTINGS\_TOKEN) ``` yaml {% include 'senhasegura-dsm-external-secret-single.yaml' %} ``` Kubernetes Secret will be create with follow `.data.X` ```bash API\_SETTINGS='[{"TOKEN":"example-token-value","URL":"https://example.com/api/example"}]' API\_SETTINGS\_TOKEN='example-token-value' ``` --- ### Sync DSM secrets using Secret Identifiers with automatically name assignments If your app requires multiples secrets, it is not required to create multiple ExternalSecret resources, as you can aggregate secrets using a single ExternalSecret resource. In this method, every secret data in Segura® creates a Kubernetes Secret `.data.X` field ``` yaml {% include 'senhasegura-dsm-external-secret-multiple.yaml' %} ``` Kubernetes Secret will be created with the following `.data.X` ```bash URL='https://example.com/api/example' TOKEN='example-token-value' DB\_HOST='db.example' DB\_PORT='5432' DB\_USERNAME='example' DB\_PASSWORD='example' ``` | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/senhasegura-dsm.md | main | external-secrets | [
-0.037672821432352066,
-0.038214363157749176,
0.01433279737830162,
0.008637812919914722,
-0.056875597685575485,
-0.047682251781225204,
0.04519873857498169,
0.04734080657362938,
0.025617294013500214,
0.02303505688905716,
0.02514064498245716,
-0.07931522279977798,
0.018084444105625153,
-0.04... | 0.162069 |
 ## Secrets Manager A `SecretStore` points to AWS Secrets Manager in a certain account within a defined region. You should define Roles that define fine-grained access to individual secrets and pass them to ESO using `spec.provider.aws.role`. This way users of the `SecretStore` can only access the secrets necessary. ``` yaml {% include 'aws-sm-store.yaml' %} ``` \*\*NOTE:\*\* In case of a `ClusterSecretStore`, Be sure to provide `namespace` in `accessKeyIDSecretRef` and `secretAccessKeySecretRef` with the namespaces where the secrets reside. \*\*NOTE:\*\* When using `dataFrom` without a `path` defined, the provider will fall back to using `ListSecrets`. `ListSecrets` then proceeds to fetch each individual secret in turn. To use `BatchGetSecretValue` and avoid excessive API calls define a `path` prefix or use `Tags` filter. ### IAM Policy Create a IAM Policy to pin down access to secrets matching `dev-\*`. For Batch permissions read the following post https://aws.amazon.com/about-aws/whats-new/2023/11/aws-secrets-manager-batch-retrieval-secrets/. ``` json { "Version": "2012-10-17", "Statement": [ { "Action" : [ "secretsmanager:ListSecrets", "secretsmanager:BatchGetSecretValue" ], "Effect" : "Allow", "Resource" : "\*" }, { "Effect": "Allow", "Action": [ "secretsmanager:GetResourcePolicy", "secretsmanager:GetSecretValue", "secretsmanager:DescribeSecret", "secretsmanager:ListSecretVersionIds" ], "Resource": [ "arn:aws:secretsmanager:us-west-2:111122223333:secret:dev-\*" ] } ] } ``` #### Permissions for PushSecret If you're planning to use `PushSecret`, ensure you also have the following permissions in your IAM policy: ``` json { "Effect": "Allow", "Action": [ "secretsmanager:CreateSecret", "secretsmanager:PutSecretValue", "secretsmanager:TagResource", "secretsmanager:DeleteSecret", "secretsmanager:GetResourcePolicy", "secretsmanager:PutResourcePolicy", "secretsmanager:DeleteResourcePolicy" ], "Resource": [ "arn:aws:secretsmanager:us-west-2:111122223333:secret:dev-\*" ] } ``` \*\*Note:\*\* The resource policy permissions (`GetResourcePolicy`, `PutResourcePolicy`, `DeleteResourcePolicy`) are only required if you're using the `resourcePolicy` metadata option to manage resource-based policies on secrets. Here's a more restrictive version of the IAM policy: ``` json { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "secretsmanager:CreateSecret", "secretsmanager:PutSecretValue", "secretsmanager:TagResource", "secretsmanager:GetResourcePolicy", "secretsmanager:PutResourcePolicy", "secretsmanager:DeleteResourcePolicy" ], "Resource": [ "arn:aws:secretsmanager:us-west-2:111122223333:secret:dev-\*" ] }, { "Effect": "Allow", "Action": [ "secretsmanager:DeleteSecret" ], "Resource": [ "arn:aws:secretsmanager:us-west-2:111122223333:secret:dev-\*" ], "Condition": { "StringEquals": { "secretsmanager:ResourceTag/managed-by": "external-secrets" } } } ] } ``` In this policy, the DeleteSecret action is restricted to secrets that have the specified tag, ensuring that deletion operations are more controlled and in line with the intended management of the secrets. #### Additional Settings for PushSecret Additional settings can be set at the `SecretStore` level to control the behavior of `PushSecret` when interacting with AWS Secrets Manager. ```yaml {% include 'aws-sm-store-secretsmanager-config.yaml' %} ``` #### Additional Metadata for PushSecret Optionally, it is possible to configure additional options for the parameter. These are as follows: - kmsKeyID - secretPushFormat - description - tags - resourcePolicy To control this behavior set the following provider metadata: ```yaml {% include 'aws-sm-push-secret-with-metadata.yaml' %} ``` - `secretPushFormat` takes two options. `binary` and `string`, where `binary` is the \_default\_. - `kmsKeyID` takes a KMS Key `$ID` or `$ARN` (in case a key source is created in another account) as a string, where `alias/aws/secretsmanager` is the \_default\_. - `description` Description of the secret. - `tags` Key-value map of user-defined tags that are attached to the secret. - `resourcePolicy` Attach a resource-based policy to the secret for cross-account access or advanced access control. - `blockPublicPolicy` (optional) - Set to `true` to validate that the policy doesn't grant public access before applying. Defaults to AWS behavior. - `policySourceRef` (required) - Reference to a ConfigMap or Secret containing the policy JSON. - `kind` - Either `ConfigMap` or `Secret`. - `name` - Name of the ConfigMap or Secret. - `key` - Key within the ConfigMap/Secret data that contains the policy JSON. ##### Resource Policy Example To attach a resource policy to a secret for cross-account access: ```yaml apiVersion: external-secrets.io/v1alpha1 kind: PushSecret metadata: name: pushsecret-example namespace: default spec: refreshInterval: 10s secretStoreRefs: - name: aws-secretsmanager kind: SecretStore selector: secret: name: pokedex-credentials data: - match: secretKey: my-secret-key remoteRef: remoteKey: my-remote-secret | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/aws-secrets-manager.md | main | external-secrets | [
-0.027845771983265877,
0.033523354679346085,
-0.05987091362476349,
0.09046535938978195,
0.003230765461921692,
0.006919530685991049,
0.003979536704719067,
0.012466062791645527,
0.0009667305275797844,
0.06635331362485886,
0.038231298327445984,
-0.07069113850593567,
0.0958627238869667,
-0.060... | 0.025647 |
contains the policy JSON. ##### Resource Policy Example To attach a resource policy to a secret for cross-account access: ```yaml apiVersion: external-secrets.io/v1alpha1 kind: PushSecret metadata: name: pushsecret-example namespace: default spec: refreshInterval: 10s secretStoreRefs: - name: aws-secretsmanager kind: SecretStore selector: secret: name: pokedex-credentials data: - match: secretKey: my-secret-key remoteRef: remoteKey: my-remote-secret property: password metadata: resourcePolicy: blockPublicPolicy: true policySourceRef: kind: ConfigMap name: my-secret-resource-policy key: policy.json kmsKeyID: bb123123-b2b0-4f60-ac3a-44a13f0e6b6c secretPushFormat: string description: "Cross-account accessible secret" tags: team: platform-engineering ``` The ConfigMap should contain the policy JSON: ```yaml apiVersion: v1 kind: ConfigMap metadata: name: my-secret-resource-policy namespace: default data: policy.json: | { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::123456789012:root" }, "Action": "secretsmanager:GetSecretValue", "Resource": "\*" } ] } ``` \*\*Note:\*\* The resource policy is applied after the secret is created or updated. If the `resourcePolicy` field is removed from metadata, the existing policy will be deleted from the secret. ### JSON Secret Values SecretsManager supports \*simple\* key/value pairs that are stored as json. If you use the API you can store more complex JSON objects. You can access nested values or arrays using [gjson syntax](https://github.com/tidwall/gjson/blob/master/SYNTAX.md): Consider the following JSON object that is stored in the SecretsManager key `friendslist`: ``` json { "name": {"first": "Tom", "last": "Anderson"}, "friends": [ {"first": "Dale", "last": "Murphy"}, {"first": "Roger", "last": "Craig"}, {"first": "Jane", "last": "Murphy"} ] } ``` This is an example on how you would look up nested keys in the above json object: ``` yaml {% include 'aws-sm-external-secret.yaml' %} ``` ### Secret Versions SecretsManager creates a new version of a secret every time it is updated. The secret version can be reference in two ways, the `VersionStage` and the `VersionId`. The `VersionId` is a unique uuid which is generated every time the secret changes. This id is immutable and will always refer to the same secret data. The `VersionStage` is an alias to a `VersionId`, and can refer to different secret data as the secret is updated. By default, SecretsManager will add the version stages `AWSCURRENT` and `AWSPREVIOUS` to every secret, but other stages can be created via the [update-secret-version-stage](https://docs.aws.amazon.com/cli/latest/reference/secretsmanager/update-secret-version-stage.html) api. The `version` field on the `remoteRef` of the ExternalSecret will normally consider the version to be a `VersionStage`, but if the field is prefixed with `uuid/`, then the version will be considered a `VersionId`. So in this example, the operator will request the same secret with different versions: `AWSCURRENT` and `AWSPREVIOUS`: ``` yaml apiVersion: external-secrets.io/v1 kind: ExternalSecret metadata: name: versioned-api-key spec: refreshInterval: 1h0m0s secretStoreRef: name: aws-secretsmanager kind: SecretStore target: name: versioned-api-key creationPolicy: Owner data: - secretKey: previous-api-key remoteRef: key: "production/api-key" version: "AWSPREVIOUS" - secretKey: current-api-key remoteRef: key: "production/api-key" version: "AWSCURRENT" ``` While in this example, the operator will request the secret with `VersionId` as `abcd-1234` ``` yaml apiVersion: external-secrets.io/v1 kind: ExternalSecret metadata: name: versioned-api-key spec: refreshInterval: 1h0m0s secretStoreRef: name: aws-secretsmanager kind: SecretStore target: name: versioned-api-key creationPolicy: Owner data: - secretKey: api-key remoteRef: key: "production/api-key" version: "uuid/123e4567-e89b-12d3-a456-426614174000" ``` --8<-- "snippets/provider-aws-access.md" | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/aws-secrets-manager.md | main | external-secrets | [
-0.09445792436599731,
0.007050322834402323,
-0.017458811402320862,
-0.01530523132532835,
0.05151822790503502,
-0.002581218956038356,
0.00411268463358283,
-0.011584462597966194,
-0.01686668023467064,
0.050448156893253326,
0.04718947038054466,
-0.09424975514411926,
0.03503613546490669,
0.007... | 0.016675 |
## IBM Cloud Secret Manager External Secrets Operator integrates with [IBM Cloud Secret Manager](https://www.ibm.com/cloud/secrets-manager) for secret management. ### Authentication We support API key and trusted profile container authentication for this provider. #### API key secret To generate your key (for test purposes we are going to generate from your user), first got to your (Access IAM) page:  On the left, click "API Keys", then click on "Create"  Pick a name and description for your key:  You have created a key. Press the eyeball to show the key. Copy or save it because keys can't be displayed or downloaded twice.  Create a secret containing your apiKey: ```shell kubectl create secret generic ibm-secret --from-literal=apiKey='API\_KEY\_VALUE' ``` #### Trusted Profile Container Auth To create the trusted profile, first got to your (Access IAM) page:  On the left, click "Access groups":  Pick a name and description for your group:  Click on "Access", and then on "Assign":  Click on "Assign Access", select "IAM services", and pick "Secrets Manager" from the pick-list:  Scope to "All resources" or "Resources based on selected attributes":  Select the "SecretsReader" service access policy:  Click "Add" and "Assign" to save the access group. Next, on the left, click "Trusted profiles":  Press "Create" and pick a name and description for your profile:  Scope the profile's access. The compute service type will be "Red Hat OpenShift on IBM Cloud". Additional restriction can be configured based on cloud or cluster metadata, or if "Specific resources" is selected, restriction to a specific cluster.  Click "Add" next to the previously created access group and then "Create", to associate the necessary service permissions.  To use the container-based authentication, it is necessary to map the API server `serviceAccountToken` auth token to the "external-secrets" and "external-secrets-webhook" deployment descriptors. Example below: ```yaml {% include 'ibm-container-auth-volume.yaml' %} ``` ### Update secret store Be sure the `ibm` provider is listed in the `Kind=SecretStore` ```yaml {% include 'ibm-secret-store.yaml' %} ``` \*\*NOTE:\*\* In case of a `ClusterSecretStore`, Be sure to provide `namespace` in `secretApiKeySecretRef` with the namespace where the secret resides. \*\*NOTE:\*\* Only `secretApiKeySecretRef` or `containerAuth` should be specified, depending on authentication method being used. To find your `serviceURL`, under your Secrets Manager resource, go to "Endpoints" on the left. See here for a list of [publicly available endpoints](https://cloud.ibm.com/apidocs/secrets-manager#getting-started-endpoints).  ### Secret Types We support the following secret types of [IBM Secrets Manager](https://cloud.ibm.com/apidocs/secrets-manager): \* `arbitrary` \* `username\_password` \* `iam\_credentials` \* `service\_credentials` \* `imported\_cert` \* `public\_cert` \* `private\_cert` \* `kv` \* `custom\_credentials` To define the type of secret you would like to sync you need to prefix the secret id with the desired type. If the secret type is not specified it is defaulted to `arbitrary`: ```yaml {% include 'ibm-es-types.yaml' %} ``` The behavior for the different secret types is as following: #### arbitrary \* `remoteRef` retrieves a string from secrets manager and sets it for specified `secretKey` \* `dataFrom` retrieves a string from secrets manager and tries to parse it as JSON object setting the key:values pairs in resulting Kubernetes secret if successful #### username\_password \* `remoteRef` requires a `property` to be set for either `username` or `password` to retrieve respective fields from the secrets manager secret and set in specified `secretKey` \* `dataFrom` retrieves both `username` and `password` fields from the secrets manager secret and sets appropriate key:value pairs in the resulting Kubernetes secret #### iam\_credentials \* `remoteRef` retrieves an apikey from secrets manager and sets it for specified `secretKey` \* `dataFrom` retrieves an apikey from secrets manager and sets it for the `apikey` Kubernetes secret key #### service\_credentials \* | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/ibm-secrets-manager.md | main | external-secrets | [
-0.10496079176664352,
-0.021415406838059425,
-0.05027516186237335,
0.015432669781148434,
0.006258158478885889,
0.03540951758623123,
0.0372772254049778,
0.033873554319143295,
0.05562114343047142,
0.05051269754767418,
0.1108584776520729,
-0.0724378377199173,
0.12426752597093582,
-0.061435017... | 0.053364 |
the secrets manager secret and sets appropriate key:value pairs in the resulting Kubernetes secret #### iam\_credentials \* `remoteRef` retrieves an apikey from secrets manager and sets it for specified `secretKey` \* `dataFrom` retrieves an apikey from secrets manager and sets it for the `apikey` Kubernetes secret key #### service\_credentials \* `remoteRef` retrieves the credentials object from secrets manager and sets it for specified `secretKey` \* `dataFrom` retrieves the credential object as a map from secrets manager and sets appropriate key:value pairs in the resulting Kubernetes secret #### imported\_cert, public\_cert, and private\_cert \* `remoteRef` requires a `property` to be set for either `certificate`, `private\_key` or `intermediate` to retrieve respective fields from the secrets manager secret and set in specified `secretKey` \* `dataFrom` retrieves all `certificate`, `private\_key` and `intermediate` fields from the secrets manager secret and sets appropriate key:value pairs in the resulting Kubernetes secret #### kv \* An optional `property` field can be set to `remoteRef` to select requested key from the KV secret. If not set, the entire secret will be returned \* `dataFrom` retrieves a string from secrets manager and tries to parse it as JSON object setting the key:values pairs in resulting Kubernetes secret if successful. It could be either used with the methods \* `Extract` to extract multiple key/value pairs from one secret (with optional `property` field being supported as well) \* `Find` to find secrets based on tags or regular expressions and allows finding multiple external secrets and map them into a single Kubernetes secret #### custom\_credentials \* An optional `property` field can be set to `remoteRef` to select requested key from the Custom Credentials secret. If not set, the entire secret will be returned \* `dataFrom` retrieves a string from secrets manager and tries to parse it as JSON object setting the key:values pairs in resulting Kubernetes secret if successful. It could be either used with the methods \* `Extract` to extract multiple key/value pairs from one secret (with optional `property` field being supported as well) \* `Find` to find secrets based on tags or regular expressions and allows finding multiple external secrets and map them into a single Kubernetes secret ```json { "key1": "val1", "key2": "val2", "key3": { "keyA": "valA", "keyB": "valB" }, "special.key": "special-content" } ``` ```yaml data: - secretKey: key3\_keyB remoteRef: key: 'kv/aaaaa-bbbb-cccc-dddd-eeeeee' property: 'key3.keyB' - secretKey: special\_key remoteRef: key: 'kv/aaaaa-bbbb-cccc-dddd-eeeeee' property: 'special.key' - secretKey: key\_all remoteRef: key: 'kv/aaaaa-bbbb-cccc-dddd-eeeeee' ``` ```yaml dataFrom: - extract: key: 'kv/fffff-gggg-iiii-dddd-eeeeee' #mandatory decodingStrategy: Base64 #optional ``` ```yaml dataFrom: - find: name: #matches any secret name ending in foo-bar regexp: "key" #assumption that secrets are stored like /comp/key1, key2/trigger, and comp/trigger/keygen within the secret manager - find: tags: #matches any secrets with the following metadata labels environment: "dev" application: "BFF" ``` results in ```yaml data: # secrets from data key3\_keyB: ... #valB special\_key: ... #special-content key\_all: ... #{"key1":"val1","key2":"val2", ..."special.key":"special-content"} # secrets from dataFrom with extract method keyA: ... #1st key-value pair from JSON object keyB: ... #2nd key-value pair from JSON object keyC: ... #3rd key-value pair from JSON object # secrets from dataFrom with find regex method \_comp\_key1: ... #secret value for /comp/key1 key2\_trigger: ... #secret value for key2/trigger \_comp\_trigger\_keygen: ... #secret value for comp/trigger/keygen # secrets from dataFrom with find tags method bffA: ... bffB: ... bffC: ... ``` ### Creating external secret To create a kubernetes secret from the IBM Secrets Manager, a `Kind=ExternalSecret` is needed. Below example creates a kubernetes secret based on ID of the secret in Secrets Manager. ```yaml {% include 'ibm-external-secret.yaml' %} ``` Alternatively, the secret name along with its secret group name can be specified instead of secret ID to | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/ibm-secrets-manager.md | main | external-secrets | [
0.00875694677233696,
0.047382596880197525,
0.0072655887342989445,
-0.021652594208717346,
-0.06301132589578629,
0.03925880044698715,
0.040582478046417236,
0.009480208158493042,
0.07061868160963058,
0.04952184483408928,
0.0208783857524395,
-0.12459735572338104,
0.09398005157709122,
-0.040067... | 0.046145 |
kubernetes secret from the IBM Secrets Manager, a `Kind=ExternalSecret` is needed. Below example creates a kubernetes secret based on ID of the secret in Secrets Manager. ```yaml {% include 'ibm-external-secret.yaml' %} ``` Alternatively, the secret name along with its secret group name can be specified instead of secret ID to fetch the secret. ```yaml {% include 'ibm-external-secret-by-name.yaml' %} ``` ### Getting the Kubernetes secret The operator will fetch the IBM Secret Manager secret and inject it as a `Kind=Secret` ``` kubectl get secret secret-to-be-created -n | -o jsonpath='{.data.test}' | base64 -d ``` ### Populating the Kubernetes secret with metadata from IBM Secrets Manager Provider ESO can add metadata while creating or updating a Kubernetes secret to be reflected in its labels or annotations. The metadata could be any of the fields that are supported and returned in the response by IBM Secrets Manager. In order for the user to opt in to adding metadata to secret, an existing optional field `spec.dataFrom.extract.metadataPolicy` can be set to `Fetch`, its default value being `None`. In addition to this, templating provided be ESO can be leveraged to specify the key-value pairs of the resultant secrets' labels and annotation. In order for the required metadata to be populated in the Kubernetes secret, combination of below should be provided in the External Secrets resource: 1. The required metadata should be specified under `template.metadata.labels` or `template.metadata.annotations`. 2. The required secret data should be specified under `template.data`. 3. The spec.dataFrom.extract should be specified with details of the Secrets Manager secret with `spec.dataFrom.extract.metadataPolicy` set to `Fetch`. Below is an example, where `secret\_id` and `updated\_at` are the metadata of a secret in IBM Secrets Manager: ```yaml {% include 'ibm-external-secret-with-metadata.yaml' %} ``` While the secret is being reconciled, it will have the secret data along with the required annotations. Below is the example of the secret after reconciliation: ```yaml apiVersion: v1 data: secret: OHE0MFV5MGhQb2FmRjZTOGVva3dPQjRMeVZXeXpWSDlrSWgyR1BiVDZTMyc= immutable: false kind: Secret metadata: annotations: reconcile.external-secrets.io/data-hash: 02217008d13ed228e75cf6d26fe74324 creationTimestamp: "2023-05-04T08:41:24Z" secret\_id: "1234" updated\_at: 2023-05-04T08:57:19Z name: database-credentials namespace: external-secrets ownerReferences: - apiVersion: external-secrets.io/v1beta1 blockOwnerDeletion: true controller: true kind: ExternalSecret name: database-credentials uid: c2a018e7-1ac3-421b-bd3b-d9497204f843 #resourceVersion: "1803567" #immutable for a user #uid: f5dff604-611b-4d41-9d65-b860c61a0b8d #immutable for a user type: Opaque ``` | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/ibm-secrets-manager.md | main | external-secrets | [
-0.0803440660238266,
0.01970668137073517,
-0.014286374673247337,
0.008655918762087822,
0.014430503360927105,
-0.019894946366548538,
0.02813873067498207,
0.013585737906396389,
0.08763694018125534,
0.01568370684981346,
0.03858171030879021,
-0.07162515074014664,
0.017285533249378204,
-0.02104... | 0.133299 |
## Yandex Lockbox External Secrets Operator integrates with [Yandex Lockbox](https://cloud.yandex.com/docs/lockbox/) for secret management. ### Prerequisites \* [External Secrets Operator installed](../introduction/getting-started.md#installing-with-helm) \* [Yandex.Cloud CLI installed](https://cloud.yandex.com/docs/cli/quickstart) ### Authentication At the moment, [authorized key](https://cloud.yandex.com/docs/iam/concepts/authorization/key) authentication is only supported: \* Create a [service account](https://cloud.yandex.com/docs/iam/concepts/users/service-accounts) in Yandex.Cloud: ```bash yc iam service-account create --name eso-service-account ``` \* Create an authorized key for the service account and save it to `authorized-key.json` file: ```bash yc iam key create \ --service-account-name eso-service-account \ --output authorized-key.json ``` \* Create a k8s secret containing the authorized key saved above: ```bash kubectl create secret generic yc-auth --from-file=authorized-key=authorized-key.json ``` \* Create a [SecretStore](../api/secretstore.md) pointing to `yc-auth` k8s secret: ```yaml apiVersion: external-secrets.io/v1 kind: SecretStore metadata: name: secret-store spec: provider: yandexlockbox: auth: authorizedKeySecretRef: name: yc-auth key: authorized-key # Optionally, to enable fetching secrets by name: # # fetching: # place "fetching:" on the same level as "auth:" # byName: # folderId: \*\*\*\*\* # ID of the folder to fetch secrets from ``` \*\*NOTE:\*\* In case of a `ClusterSecretStore`, Be sure to provide `namespace` in all `authorizedKeySecretRef` with the namespace where the secret resides. ### Creating external secret To make External Secrets Operator sync a k8s secret with a Lockbox secret: \* Create a Lockbox secret, if not already created: ```bash yc lockbox secret create \ --name lockbox-secret \ --payload '[{"key": "password","textValue": "p@$$w0rd"}]' ``` \* Assign the [`lockbox.payloadViewer`](https://cloud.yandex.com/docs/lockbox/security/#roles-list) role for accessing the `lockbox-secret` payload to the service account used for authentication: ```bash yc lockbox secret add-access-binding \ --name lockbox-secret \ --service-account-name eso-service-account \ --role lockbox.payloadViewer ``` Run the following command to ensure that the correct access binding has been added: ```bash yc lockbox secret list-access-bindings --name lockbox-secret ``` \* Create an [ExternalSecret](../api/externalsecret.md) pointing to `secret-store` and `lockbox-secret`: ```yaml apiVersion: external-secrets.io/v1 kind: ExternalSecret metadata: name: external-secret spec: refreshInterval: 1h0m0s secretStoreRef: name: secret-store kind: SecretStore target: name: k8s-secret # the target k8s secret name data: - secretKey: password # the target k8s secret key remoteRef: key: \*\*\*\*\* # either ID or name of the secret, depending on fetching policy byID / byName property: password # (optional) payload entry key of lockbox-secret ``` The operator will fetch the Yandex Lockbox secret and inject it as a `Kind=Secret` ```yaml kubectl get secret k8s-secret -n -o jsonpath='{.data.password}' | base64 -d ``` | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/yandex-lockbox.md | main | external-secrets | [
-0.08954530954360962,
-0.022168954834342003,
0.004121060948818922,
-0.02688216231763363,
0.012476843781769276,
0.030789967626333237,
0.0854262113571167,
-0.0355699248611927,
0.06588698923587799,
0.0545533187687397,
0.03675497695803642,
-0.009218528866767883,
0.06395365297794342,
-0.0112322... | 0.06569 |
## BeyondTrust Password Safe External Secrets Operator integrates with [BeyondTrust Password Safe](https://www.beyondtrust.com/docs/beyondinsight-password-safe/). Warning: The External Secrets Operator secure usage involves taking several measures. Please see [Security Best Practices](https://external-secrets.io/latest/guides/security-best-practices/) for more information. Warning: If the BT provider secret is deleted it will still exist in the Kubernetes secrets. ### Prerequisites The BT provider supports retrieval of a secret from BeyondInsight/Password Safe versions 23.1 or greater. For this provider to retrieve a secret the Password Safe/Secrets Safe instance must be preconfigured with the secret in question and authorized to read it. ### Authentication BeyondTrust [OAuth Authentication](https://www.beyondtrust.com/docs/beyondinsight-password-safe/ps/admin/configure-api-registration.htm). 1. Create an API access registration in BeyondInsight 2. Create or use an existing Secrets Safe Group 3. Create or use an existing Application User 4. Add API registration to the Application user 5. Add the user to the group 6. Add the Secrets Safe Feature to the group > NOTE: The ClientID and ClientSecret must be stored in a Kubernetes secret in order for the SecretStore to read the configuration. If you're using client credentials authentication: ```sh kubectl create secret generic bt-secret --from-literal ClientSecret="" kubectl create secret generic bt-id --from-literal ClientId="" ``` If you're using API Key authentication: ```sh kubectl create secret generic bt-apikey --from-literal ApiKey="" ``` ### Client Certificate If using `retrievalType: MANAGED\_ACCOUNT`, you will also need to download the pfx certificate from Secrets Safe, extract that certificate and create two Kubernetes secrets. ```sh openssl pkcs12 -in client\_certificate.pfx -nocerts -out ps\_key.pem -nodes openssl pkcs12 -in client\_certificate.pfx -clcerts -nokeys -out ps\_cert.pem # Copy the text from the ps\_key.pem to a file. -----BEGIN PRIVATE KEY----- ... -----END PRIVATE KEY----- # Copy the text from the ps\_cert.pem to a file. -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- kubectl create secret generic bt-certificate --from-file=ClientCertificate=./ps\_cert.pem kubectl create secret generic bt-certificatekey --from-file=ClientCertificateKey=./ps\_key.pem ``` ### Creating a SecretStore You can follow the below example to create a `SecretStore` resource. You can also use a `ClusterSecretStore` allowing you to reference secrets from all namespaces. [ClusterSecretStore](https://external-secrets.io/latest/api/clustersecretstore/) ```sh kubectl apply -f secret-store.yml ``` ```yaml apiVersion: external-secrets.io/v1 kind: SecretStore metadata: name: secretstore-beyondtrust spec: provider: beyondtrust: server: apiUrl: https://example.com:443/BeyondTrust/api/public/v3/ retrievalType: MANAGED\_ACCOUNT # or SECRET verifyCA: true clientTimeOutSeconds: 45 apiVersion: "3.0" # The recommended version is 3.1. If no version is specified, the default API version 3.0 will be used. auth: certificate: # omit certificates if retrievalType is SECRET secretRef: name: bt-certificate key: ClientCertificate certificateKey: secretRef: name: bt-certificatekey key: ClientCertificateKey clientSecret: # define this section if using client credentials authentication secretRef: name: bt-secret key: ClientSecret clientId: # define this section if using client credentials authentication secretRef: name: bt-id key: ClientId apiKey: # define this section if using Api Key authentication secretRef: name: bt-apikey key: ApiKey ``` ### Creating an ExternalSecret You can follow the below example to create a `ExternalSecret` resource. Secrets can be referenced by path. You can also use a `ClusterExternalSecret` allowing you to reference secrets from all namespaces. ```sh kubectl apply -f external-secret.yml ``` ```yaml {% include 'beyondtrust-external-secret.yaml' %} ``` ### Get the K8s secret ```shell # WARNING: this command will reveal the stored secret in plain text kubectl get secret my-beyondtrust-secret -o jsonpath="{.data.secretKey}" | base64 --decode && echo ``` ### Creating a Secret The following example shows how to create a Kubernetes `Secret` that will later be pushed to BeyondTrust. ```sh kubectl apply -f beyondtrust-secret.yml ``` ```yaml {% include 'beyondtrust-secret.yaml' %} ``` ### Creating an ClusterSecretStore The following example demonstrates how to create a `ClusterSecretStore` configured to use the BeyondTrust provider. ```sh kubectl apply -f beyondtrust-cluster-secret-store.yml ``` ```yaml {% include 'beyondtrust-cluster-secret-store.yaml' %} ``` ### Creating an PushSecret The example below demonstrates how to create a `PushSecret` resource to push secret data to BeyondTrust. ```sh kubectl | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/beyondtrust.md | main | external-secrets | [
-0.07760142534971237,
-0.04165288060903549,
-0.0011533289216458797,
-0.018799006938934326,
0.05323919281363487,
-0.002391805173829198,
0.026801088824868202,
0.01909460686147213,
0.07293709367513657,
0.0024367792066186666,
0.010411811992526054,
-0.022778956219553947,
0.07248464226722717,
-0... | 0.056342 |
ClusterSecretStore The following example demonstrates how to create a `ClusterSecretStore` configured to use the BeyondTrust provider. ```sh kubectl apply -f beyondtrust-cluster-secret-store.yml ``` ```yaml {% include 'beyondtrust-cluster-secret-store.yaml' %} ``` ### Creating an PushSecret The example below demonstrates how to create a `PushSecret` resource to push secret data to BeyondTrust. ```sh kubectl apply -f beyondtrust-push-secret.yml ``` ```yaml {% include 'beyondtrust-push-secret.yaml' %} ``` | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/beyondtrust.md | main | external-secrets | [
-0.024575451388955116,
-0.045477259904146194,
-0.017934562638401985,
0.003892450127750635,
-0.0015004188753664494,
-0.02401995286345482,
-0.009266864508390427,
0.03924519196152687,
0.03593869134783745,
0.04331963509321213,
0.07023763656616211,
-0.10722745209932327,
0.07226767390966415,
-0.... | 0.098959 |
## Pulumi ESC Sync environments, configs and secrets from [Pulumi ESC](https://www.pulumi.com/product/esc/) to Kubernetes using the External Secrets Operator.  More information about setting up [Pulumi](https://www.pulumi.com/) ESC can be found in the [Pulumi ESC documentation](https://www.pulumi.com/docs/esc/). ### Authentication Pulumi [Access Tokens](https://www.pulumi.com/docs/pulumi-cloud/access-management/access-tokens/) are recommended to access Pulumi ESC. ### Creating a SecretStore A Pulumi `SecretStore` can be created by specifying the `organization`, `project` and `environment` and referencing a Kubernetes secret containing the `accessToken`. ```yaml apiVersion: external-secrets.io/v1 kind: SecretStore metadata: name: secret-store spec: provider: pulumi: organization: project: environment: accessToken: secretRef: name: key: ``` If required, the API URL (`apiUrl`) can be customized as well. If not specified, the default value is `https://api.pulumi.com/api/esc`. ### Creating a ClusterSecretStore Similarly, a `ClusterSecretStore` can be created by specifying the `namespace` and referencing a Kubernetes secret containing the `accessToken`. ```yaml apiVersion: external-secrets.io/v1 kind: ClusterSecretStore metadata: name: secret-store spec: provider: pulumi: organization: project: environment: accessToken: secretRef: name: key: namespace: ``` ### Referencing Secrets Secrets can be referenced by defining the `key` containing the JSON path to the secret. Pulumi ESC secrets are internally organized as a JSON object. ```yaml apiVersion: external-secrets.io/v1 kind: ExternalSecret metadata: name: secret spec: refreshInterval: 1h0m0s secretStoreRef: kind: SecretStore name: secret-store data: - secretKey: remoteRef: key: ``` \*\*Note:\*\* `key` is not following the JSON Path syntax, but rather the Pulumi path syntax. #### Examples \* root \* root.nested \* root["nested"] \* root.double.nest \* root["double"].nest \* root["double"]["nest"] \* root.array[0] \* root.array[100] \* root.array[0].nested \* root.array[0][1].nested \* root.nested.array[0].double[1] \* root["key with \"escaped\" quotes"] \* root["key with a ."] \* ["root key with \"escaped\" quotes"].nested \* ["root key with a ."][100] \* root.array[\*].field \* root.array["\*"].field See [Pulumi's documentation](https://www.pulumi.com/docs/concepts/options/ignorechanges/) for more information. ### PushSecrets With the latest release of Pulumi ESC, secrets can be pushed to the Pulumi service. This can be done by creating a `PushSecrets` object. Here is a basic example of how to define a `PushSecret` object: ```yaml apiVersion: external-secrets.io/v1alpha1 kind: PushSecret metadata: name: push-secret-example spec: refreshInterval: 1h0m0s selector: secret: name: secretStoreRefs: - kind: ClusterSecretStore name: secret-store data: - match: secretKey: remoteRef: remoteKey: ``` This will then push the secret to the Pulumi service. If the secret already exists, it will be updated. ### Limitations Currently, the Pulumi provider only supports nested objects up to a depth of 1. Any nested objects beyond this depth will be stored as a string with the JSON representation. This Pulumi ESC example: ```yaml values: backstage: my: test test: hello test22: my: hello test33: world: true x: true num: 42 ``` Will result in the following Kubernetes secret: ```yaml my: test num: "42" test: hello test22: '{"my":{"trace":{"def":{"begin":{"byte":72,"column":11,"line":6},"end":{"byte":77,"column":16,"line":6},"environment":"tgif-demo"}},"value":"hello"}}' test33: '{"world":{"trace":{"def":{"begin":{"byte":103,"column":14,"line":8},"end":{"byte":107,"column":18,"line":8},"environment":"tgif-demo"}},"value":true}}' x: "true" ``` | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/pulumi.md | main | external-secrets | [
-0.0814611166715622,
-0.06986810266971588,
-0.06360509991645813,
-0.03393648937344551,
-0.0528143085539341,
-0.025745032355189323,
0.028397098183631897,
-0.04223966598510742,
0.05382751300930977,
0.008991464041173458,
0.04793263599276543,
-0.06600897014141083,
0.02863665297627449,
-0.03943... | 0.157096 |
## Chef `Chef External Secrets provider` will enable users to seamlessly integrate their Chef-based secret management with Kubernetes through the existing External Secrets framework. In many enterprises, legacy applications and infrastructure are still tightly integrated with the Chef/Chef Infra Server/Chef Server Cluster for configuration and secrets management. Teams often rely on [Chef data bags](https://docs.chef.io/data\_bags/) to securely store sensitive information such as application secrets and infrastructure configurations. These data bags serve as a centralized repository for managing and distributing sensitive data across the Chef ecosystem. \*\*NOTE:\*\* `Chef External Secrets provider` is designed only to fetch data from the Chef data bags into Kubernetes secrets, it won't update/delete any item in the data bags. ### Authentication Every request made to the Chef Infra server needs to be authenticated. [Authentication](https://docs.chef.io/server/auth/) is done using the Private keys of the Chef Users. The User needs to have appropriate [Permissions](https://docs.chef.io/server/server\_orgs/#permissions) to the data bags containing the data that they want to fetch using the External Secrets Operator. The following command can be used to create Chef Users: ```sh chef-server-ctl user-create USER\_NAME FIRST\_NAME [MIDDLE\_NAME] LAST\_NAME EMAIL 'PASSWORD' (options) ``` More details on the above command are available here [Chef User Create Option](https://docs.chef.io/server/server\_users/#user-create). The above command will return the default private key (PRIVATE\_KEY\_VALUE), which we will use for authentication. Additionally, a Chef User with access to specific data bags, a private key pair with an expiration date can be created with the help of the [knife user key](https://docs.chef.io/server/auth/#knife-user-key) command. ### Create a secret containing your private key We need to store the above User's API key into a secret resource. Example: ```sh kubectl create secret generic chef-user-secret -n vivid --from-literal=user-private-key='PRIVATE\_KEY\_VALUE' ``` ### Creating ClusterSecretStore The Chef `ClusterSecretStore` is a cluster-scoped SecretStore that can be referenced by all Chef `ExternalSecrets` from all namespaces. You can follow the below example to create a `ClusterSecretStore` resource. ```yaml apiVersion: external-secrets.io/v1 kind: ClusterSecretStore metadata: name: vivid-clustersecretstore # name of ClusterSecretStore spec: provider: chef: username: user # Chef User name serverUrl: https://manage.chef.io/organizations/testuser/ # Chef server URL auth: secretRef: privateKeySecretRef: key: user-private-key # name of the key inside Secret resource name: chef-user-secret # name of Kubernetes Secret resource containing the Chef User's private key namespace: vivid # the namespace in which the above Secret resource resides ``` ### Creating SecretStore Chef `SecretStores` are bound to a namespace and can not reference resources across namespaces. For cross-namespace SecretStores, you must use Chef `ClusterSecretStores`. You can follow the below example to create a `SecretStore` resource. ```yaml apiVersion: external-secrets.io/v1 kind: SecretStore metadata: name: vivid-secretstore # name of SecretStore namespace: vivid # must be required for kind: SecretStore spec: provider: chef: username: user # Chef User name serverUrl: https://manage.chef.io/organizations/testuser/ # Chef server URL auth: secretRef: privateKeySecretRef: name: chef-user-secret # name of Kubernetes Secret resource containing the Chef User's private key key: user-private-key # name of the key inside Secret resource namespace: vivid # the ns where the k8s secret resource containing Chef User's private key resides ``` ### Creating ExternalSecret The Chef `ExternalSecret` describes what data should be fetched from Chef Data bags, and how the data should be transformed and saved as a Kind=Secret. You can follow the below example to create an `ExternalSecret` resource. ```yaml {% include 'chef-external-secret.yaml' %} ``` When the above `ClusterSecretStore` and `ExternalSecret` resources are created, the `ExternalSecret` will connect to the Chef Server using the private key and will fetch the data bags contained in the `vivid-credentials` secret resource. To get all data items inside the data bag, you can use the `dataFrom` directive: ```yaml apiVersion: external-secrets.io/v1 kind: ExternalSecret metadata: name: vivid-external-secrets # name of ExternalSecret namespace: vivid # namespace inside which the | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/chef.md | main | external-secrets | [
-0.047125060111284256,
0.010388706810772419,
-0.039461683481931686,
-0.0010877575259655714,
-0.010455641895532608,
-0.02162804827094078,
-0.006404178217053413,
-0.029617058113217354,
0.08033169060945511,
-0.055552855134010315,
0.04024598002433777,
-0.020540326833724976,
-0.004620484076440334... | 0.134918 |
using the private key and will fetch the data bags contained in the `vivid-credentials` secret resource. To get all data items inside the data bag, you can use the `dataFrom` directive: ```yaml apiVersion: external-secrets.io/v1 kind: ExternalSecret metadata: name: vivid-external-secrets # name of ExternalSecret namespace: vivid # namespace inside which the ExternalSecret will be created annotations: company/contacts: user.a@company.com, user.b@company.com company/team: vivid-dev labels: app.kubernetes.io/name: external-secrets spec: refreshInterval: 1h0m0s secretStoreRef: name: vivid-clustersecretstore # name of ClusterSecretStore kind: ClusterSecretStore dataFrom: - extract: key: vivid\_global # only data bag name target: name: vivid\_global\_all\_cred # name of Kubernetes Secret resource that will be created and will contain the obtained secrets creationPolicy: Owner ``` follow : [this file](https://github.com/external-secrets/external-secrets/blob/main/apis/externalsecrets/v1beta1/secretstore\_chef\_types.go) for more info | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/chef.md | main | external-secrets | [
-0.037642333656549454,
0.026075249537825584,
-0.025927148759365082,
0.03652413561940193,
0.046988192945718765,
-0.05507352948188782,
0.057781919836997986,
0.023768335580825806,
0.10121019929647446,
0.013123824261128902,
0.02616208977997303,
-0.09414629638195038,
0.02014879696071148,
-0.062... | 0.068238 |
 ## Onboardbase Secret Management Sync secrets from [Onboardbase](https://www.onboardbase.com/) to Kubernetes using the External Secrets Operator. ## Authentication ### Get an Onboardbase [API Key](https://docs.onboardbase.com/reference/api-auth). Create the Onboardbase API by opening the organization tab under your account settings:  And view them under the team name in your Account settings  Create an Onboardbase API secret with your API Key and Passcode value: ```sh HISTIGNORE='\*kubectl\*' \ kubectl create secret generic onboardbase-auth-secret \ --from-literal=API\_KEY=\*\*\*\*\*VZYKYJNMMEMK\*\*\*\*\* \ --from-literal=PASSCODE=api-key-passcode ``` Then to create a generic `SecretStore`: ```yaml {% include 'onboardbase-generic-secret-store.yaml' %} ``` ## Use Cases The below operations are possible with the Onboardbase provider: 1. [Fetch](#1-fetch) 2. [Fetch all](#2-fetch-all) 3. [Filter](#3-filter) Let's explore each use case using a fictional `auth-api` Onboardbase project. ### 1. Fetch To sync one or more individual secrets: ```yaml {% include 'onboardbase-fetch-secret.yaml' %} ``` ### 2. Fetch all To sync every secret from a config: ```yaml {% include 'onboardbase-fetch-all-secrets.yaml' %} ``` ### 3. Filter To filter secrets by `path` (path prefix), `name` (regular expression) or a combination of both: ```yaml {% include 'onboardbase-filtered-secrets.yaml' %} ``` | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/onboardbase.md | main | external-secrets | [
-0.01961020566523075,
-0.00941306073218584,
-0.005392199847847223,
0.009211182594299316,
-0.011245613917708397,
0.0269631315022707,
-0.010946777649223804,
0.01660677045583725,
0.059068381786346436,
0.050945721566677094,
-0.022387666627764702,
-0.07860779762268066,
0.0633552074432373,
-0.02... | 0.070063 |
## Keeper Security External Secrets Operator integrates with [Keeper Security](https://www.keepersecurity.com/) for secret management by using [Keeper Secrets Manager](https://docs.keeper.io/secrets-manager/secrets-manager/about). ## Authentication ### Secrets Manager Configuration (SMC) KSM can authenticate using \*One Time Access Token\* or \*Secret Manager Configuration\*. In order to work with External Secret Operator we need to configure a Secret Manager Configuration. #### Creating Secrets Manager Configuration You can find the documentation for the Secret Manager Configuration creation [here](https://docs.keeper.io/secrets-manager/secrets-manager/about/secrets-manager-configuration). Make sure you add the proper permissions to your device in order to be able to read and write secrets Once you have created your SMC, you will get a config.json file or a base64 json encoded string containing the following keys: - `hostname` - `clientId` - `privateKey` - `serverPublicKeyId` - `appKey` - `appOwnerPublicKey` This base64 encoded jsong string will be required to create your secretStores ## Important note about this documentation \_\*\*The KeeperSecurity calls the entries in vaults 'Records'. These docs use the same term.\*\*\_ ### Update secret store Be sure the `keepersecurity` provider is listed in the `Kind=SecretStore` ```yaml {% include 'keepersecurity-secret-store.yaml' %} ``` \*\*NOTE 1:\*\* `folderID` target the folder ID where the secrets should be pushed to. It requires write permissions within the folder \*\*NOTE 2:\*\* In case of a `ClusterSecretStore`, Be sure to provide `namespace` for `SecretAccessKeyRef` with the namespace of the secret that we just created. ## External Secrets ### Behavior \* How a Record is equated to an ExternalSecret: \* `remoteRef.key` is equated to a Record's ID \* `remoteRef.property` is equated to one of the following options: \* Fields: Record's field's Label (if present), otherwise [Record's field's Type](https://docs.keeper.io/secrets-manager/secrets-manager/about/field-record-types) \* CustomFields: Record's field's Label \* Files: Record's file's Name \* If empty, defaults to the complete Record in JSON format \* `remoteRef.version` is currently not supported. \* `dataFrom`: \* `find.path` is currently not supported. \* `find.name.regexp` is equated to one of the following options: \* Fields: Record's field's Label (if present), otherwise Record's field's Type \* CustomFields: Record's field's Label \* Files: Record's file's Name \* `find.tags` are not supported at this time. \*\*NOTE:\*\* For complex [types](https://docs.keeper.io/secrets-manager/secrets-manager/about/field-record-types), like name, phone, bankAccount, which does not match with a single string value, external secrets will return the complete json string. Use the json template functions to decode. ### Creating external secret To create a kubernetes secret from Keeper Secret Manager secret a `Kind=ExternalSecret` is needed. ```yaml {% include 'keepersecurity-external-secret.yaml' %} ``` The operator will fetch the Keeper Secret Manager secret and inject it as a `Kind=Secret` ``` kubectl get secret secret-to-be-created -n | -o jsonpath='{.data.dev-secret-test}' | base64 -d ``` ## Limitations There are some limitations using this provider. \* Keeper Secret Manager does not work with `General` Records types nor legacy non-typed records \* Using tags `find.tags` is not supported by KSM \* Using path `find.path` is not supported at the moment ## Push Secrets Push Secret will only work with a custom KeeperSecurity Record type `externalSecrets` ### Behavior \* `selector`: \* `secret.name`: name of the kubernetes secret to be pushed \* `data.match`: \* `secretKey`: key on the selected secret to be pushed \* `remoteRef.remoteKey`: Secret and key to be created on the remote provider \* Format: SecretName/SecretKey ### Creating push secret To create a Keeper Security record from kubernetes a `Kind=PushSecret` is needed. ```yaml {% include 'keepersecurity-push-secret.yaml' %} ``` ### Limitations \* Only possible to push one key per secret at the moment \* If the record with the selected name exists but the key does not exist, the record cannot be updated. See [Ability to add custom fields to existing secret #17](https://github.com/Keeper-Security/secrets-manager-go/issues/17) | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/keeper-security.md | main | external-secrets | [
-0.05971168726682663,
-0.03849296271800995,
-0.025375038385391235,
0.005971087608486414,
-0.04157554730772972,
0.0006513898260891438,
-0.008734483271837234,
0.05052917078137398,
0.034575484693050385,
0.046353526413440704,
0.0196861419826746,
-0.06066087260842323,
0.04178581386804581,
-0.02... | 0.063028 |
one key per secret at the moment \* If the record with the selected name exists but the key does not exist, the record cannot be updated. See [Ability to add custom fields to existing secret #17](https://github.com/Keeper-Security/secrets-manager-go/issues/17) | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/keeper-security.md | main | external-secrets | [
-0.06596273928880692,
0.029747426509857178,
-0.0889921635389328,
0.013121260330080986,
-0.034937430173158646,
0.012397254817187786,
0.04199041798710823,
-0.03122984990477562,
0.05610928684473038,
0.015709163621068,
0.07746101915836334,
-0.050947342067956924,
0.08492937684059143,
-0.0696256... | 0.018512 |
## GitHub External Secrets Operator integrates with GitHub to sync Kubernetes secrets with [GitHub Actions secrets](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions). ### Limitations The GitHub provider is \*\*write-only\*\*, designed specifically to \*\*create and update\*\* GitHub Actions secrets using the [GitHub REST API](https://docs.github.com/en/rest/actions/secrets), and does not support \*\*fetching the secret values\*\*. ### Configuring GitHub provider The GitHub API requires to install the ESO app to your GitHub organisation in order to use the GitHub provider features. ### Configuring the secret store Verify that `github` provider is listed in the `Kind=SecretStore`. The properties `appID`, `installationID`, `organization` are required to register the provider. In addition, authentication has to be provided. Optionally, to target `repository` and `environment` secrets, the fields `repository` and `environment` need also to be added. ```yaml {% include 'github-secret-store.yaml' %} ``` \*\*NOTE:\*\* In case of a `ClusterSecretStore`, Be sure to provide `namespace` in `accessToken` with the namespace where the secret resides. ### Pushing to an external secret To sync a Kubernetes secret with an external GitHub secret we need to create a PushSecret, this means a `Kind=PushSecret` is needed. ```yaml {% include 'github-push-secret.yaml' %} ``` | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/github.md | main | external-secrets | [
-0.061393190175294876,
-0.043312039226293564,
0.006266511511057615,
0.009973578155040741,
-0.02515273541212082,
-0.006276286207139492,
-0.01859757862985134,
0.012595762498676777,
0.08209152519702911,
0.05096891522407532,
0.015462450683116913,
-0.04605972766876221,
0.045438822358846664,
-0.... | 0.149339 |
## Bitwarden Secrets Manager Provider This section describes how to set up the Bitwarden Secrets Manager provider for External Secrets Operator (ESO). !!! note [Bitwarden Secrets Manager](https://bitwarden.com/products/secrets-manager/) enables developers, DevOps, and cybersecurity teams to centrally store, manage, and deploy secrets at scale. This is different from [Bitwarden Password Manager](https://bitwarden.com/products/personal/). To integrate with Bitwarden \*\*Password Manager\*\*, reference the [example documentation](../examples/bitwarden.md). ### Prerequisites In order for the Bitwarden provider to work, we need a second service. This service is the [Bitwarden SDK Server](https://github.com/external-secrets/bitwarden-sdk-server). The Bitwarden SDK is Rust based and requires CGO enabled. In order to not restrict the capabilities of ESO, and the image size ( the bitwarden Rust SDK libraries are over 150MB in size ) it has been decided to create a soft wrapper around the SDK that runs as a separate service providing ESO with a light REST API to pull secrets through. #### Bitwarden SDK server The server itself can be installed together with ESO. The ESO Helm Chart packages this service as a dependency. The Bitwarden SDK Server's full name is hardcoded to bitwarden-sdk-server. This is so that the exposed service URL gets a determinable endpoint. In order to install the service install ESO with the following helm directive: ``` helm install external-secrets \ external-secrets/external-secrets \ -n external-secrets \ --create-namespace \ --set bitwarden-sdk-server.enabled=true ``` ##### Certificate The Bitwarden SDK Server \_NEEDS\_ to run as an HTTPS service. That means that any installation that wants to communicate with the Bitwarden provider will need to generate a certificate. The best approach for that is to use cert-manager. It's easy to set up and can generate a certificate that the store can use to connect with the server. For a sample set up look at the bitwarden sdk server's test setup. It contains a self-signed certificate issuer for cert-manager. ### External secret store With that out of the way, let's take a look at how a secret store would look like. ```yaml {% include 'bitwarden-secrets-manager-secret-store.yaml' %} ``` The api url and identity url are optional. The secret should contain the token for the Machine account for bitwarden. !!! note inline end Make sure that the machine account has Read-Write access to the Project that the secrets are in. !!! note inline end A secret store is organization/project dependent. Meaning a 1 store == 1 organization/project. This is so that we ensure that no other project's secrets can be modified accidentally \_or\_ intentionally. ### External Secrets There are two ways to fetch secrets from the provider. #### Find by UUID In order to fetch a secret by using its UUID simply provide that as remote key in the external secrets like this: ```yaml apiVersion: external-secrets.io/v1 kind: ExternalSecret metadata: name: bitwarden spec: refreshInterval: 1h0m0s secretStoreRef: # This name must match the metadata.name in the `SecretStore` name: bitwarden-secretsmanager kind: SecretStore data: - secretKey: test remoteRef: key: "339062b8-a5a1-4303-bf1d-b1920146a622" ``` #### Find by Name To find a secret using its name, we need a bit more information. Mainly, these are the rules to find a secret: - if name is a UUID get the secret - if name is NOT a UUID Property is mandatory that defines the projectID to look for - if name + projectID + organizationID matches, we return that secret - if more than one name exists for the same projectID within the same organization we error ```yaml apiVersion: external-secrets.io/v1 kind: ExternalSecret metadata: name: bitwarden spec: refreshInterval: 1h0m0s secretStoreRef: # This name must match the metadata.name in the `SecretStore` name: bitwarden-secretsmanager kind: SecretStore data: - secretKey: test remoteRef: key: "secret-name" ``` #### DataFrom When using dataFrom like this: ```yaml dataFrom: | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/bitwarden-secrets-manager.md | main | external-secrets | [
-0.10554347932338715,
-0.041133541613817215,
-0.054768066853284836,
-0.028559239581227303,
-0.013131656683981419,
-0.022112231701612473,
0.03299100324511528,
0.05289912968873978,
-0.04608473554253578,
-0.006181747652590275,
0.0029511828906834126,
0.011414135806262493,
0.055550020188093185,
... | 0.184807 |
projectID within the same organization we error ```yaml apiVersion: external-secrets.io/v1 kind: ExternalSecret metadata: name: bitwarden spec: refreshInterval: 1h0m0s secretStoreRef: # This name must match the metadata.name in the `SecretStore` name: bitwarden-secretsmanager kind: SecretStore data: - secretKey: test remoteRef: key: "secret-name" ``` #### DataFrom When using dataFrom like this: ```yaml dataFrom: - find: conversionStrategy: Default decodingStrategy: None name: regexp: db\_ ``` Note that the secrets in the map will end up something like this: ``` $ kubectl get secret secret-to-be-created -o jsonpath='{.data}'|jq { "2989464a-03c2-4ced-9fe2-b34400aca42d": "bG9jYWxob3N0OjEyMzQ1", "98c18ddb-314e-463c-97c3-b34400ac6593": "dWFzZXJuYW1lMQ==", "c917a790-76bc-49ca-b303-b34400ac8035": "UGFzc1dvcmQx", } ``` The finder uses the ID of the key instead of the name because in Bitwarden, having the same key/name for a secret inside the same project is a \_VALID\_ option. Meaning, potentially, a secret could overwrite another secret in the secret data map. Hence, the ID of the secret is used when listing all secrets. This is inconvenient because now we can hardly refer to these secrets anymore from code. Hence, it is advised to use a rewrite rule with templates or to avoid using dataFrom field. ### Push Secret Pushing a secret is also implemented. Pushing a secret requires even more restrictions because Bitwarden Secrets Manager allows creating the same secret with the same key multiple times. In order to avoid overwriting, or potentially, returning the wrong secret, we restrict push secret with the following rules: - name, projectID, organizationID and value AND NOTE equal, we won't push it again. - name, projectID, organizationID and ONLY the value does not equal ( INCLUDING THE NOTE ) we update - any of the above isn't true, we create the secret ( this means that it will create a secret in a separate project ) ```yaml apiVersion: external-secrets.io/v1alpha1 kind: PushSecret metadata: name: pushsecret-bitwarden # Customisable spec: refreshInterval: 1h0m0s # Refresh interval for which push secret will reconcile secretStoreRefs: # A list of secret stores to push secrets to - name: bitwarden-secretsmanager kind: SecretStore selector: secret: name: my-secret # Source Kubernetes secret to be pushed data: - match: secretKey: key # Source Kubernetes secret key to be pushed remoteRef: remoteKey: remote-key-name # Remote reference (where the secret is going to be pushed) metadata: note: "Note of the secret to add." ``` | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/bitwarden-secrets-manager.md | main | external-secrets | [
-0.04182783141732216,
0.0010548339923843741,
-0.005513304378837347,
0.005026023369282484,
-0.025375565513968468,
-0.030674975365400314,
-0.04187754914164543,
-0.03039352409541607,
0.07574314624071121,
0.039196617901325226,
0.03462468832731247,
-0.09725847095251083,
0.008927568793296814,
-0... | 0.023484 |
!!! warning "Provider Deprecated" This provider is deprecated due to lack of maintenance and licensing issues. It will be removed on the next minor release. ## Alibaba Cloud Secrets Manager External Secrets Operator integrates with [Alibaba Cloud Key Management Service](https://www.alibabacloud.com/help/en/key-management-service/latest/kms-what-is-key-management-service/) for secrets and Keys management. ### Authentication We support Access key and RRSA authentication. To use RRSA authentication, you should follow [Use RRSA to authorize pods to access different cloud services](https://www.alibabacloud.com/help/en/container-service-for-kubernetes/latest/use-rrsa-to-enforce-access-control/) to assign the RAM role to external-secrets operator. #### Access Key authentication To use `accessKeyID` and `accessKeySecrets`, simply create them as a regular `Kind: Secret` beforehand and associate it with the `SecretStore`: ```yaml apiVersion: v1 kind: Secret metadata: name: secret-sample data: accessKeyID: bXlhd2Vzb21lYWNjZXNza2V5aWQ= accessKeySecret: bXlhd2Vzb21lYWNjZXNza2V5c2VjcmV0 ``` ```yaml apiVersion: external-secrets.io/v1 kind: SecretStore metadata: name: secretstore-sample spec: provider: alibaba: regionID: ap-southeast-1 auth: secretRef: accessKeyIDSecretRef: name: secret-sample key: accessKeyID accessKeySecretSecretRef: name: secret-sample key: accessKeySecret ``` #### RRSA authentication When using RRSA authentication we manually project the OIDC token file to pod as volume ```yaml extraVolumes: - name: oidc-token projected: sources: - serviceAccountToken: path: oidc-token expirationSeconds: 7200 # The validity period of the OIDC token in seconds. audience: "sts.aliyuncs.com" extraVolumeMounts: - name: oidc-token mountPath: /var/run/secrets/tokens ``` and provide the RAM role ARN and OIDC volume path to the secret store ```yaml apiVersion: external-secrets.io/v1 kind: SecretStore metadata: name: secretstore-sample spec: provider: alibaba: regionID: ap-southeast-1 auth: rrsa: oidcProviderArn: acs:ram::1234:oidc-provider/ack-rrsa-ce123456 oidcTokenFilePath: /var/run/secrets/tokens/oidc-token roleArn: acs:ram::1234:role/test-role sessionName: secrets ``` ### Creating external secret To create a kubernetes secret from the Alibaba Cloud Key Management Service secret a `Kind=ExternalSecret` is needed. ```yaml apiVersion: external-secrets.io/v1 kind: ExternalSecret metadata: name: example spec: refreshInterval: 1h0m0s secretStoreRef: name: secretstore-sample kind: SecretStore target: name: example-secret creationPolicy: Owner data: - secretKey: secret-key remoteRef: key: ext-secret ``` | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/alibaba.md | main | external-secrets | [
-0.025745121762156487,
0.0050721378065645695,
-0.027391355484724045,
0.005461610853672028,
-0.06543879210948944,
0.043670762330293655,
0.017070572823286057,
0.008534416556358337,
0.0754476860165596,
0.060050979256629944,
0.0020001535303890705,
0.01485644280910492,
0.057010237127542496,
-0.... | 0.099092 |
## Yandex Certificate Manager External Secrets Operator integrates with [Yandex Certificate Manager](https://cloud.yandex.com/docs/certificate-manager/) for secret management. ### Prerequisites \* [External Secrets Operator installed](../introduction/getting-started.md#installing-with-helm) \* [Yandex.Cloud CLI installed](https://cloud.yandex.com/docs/cli/quickstart) ### Authentication At the moment, [authorized key](https://cloud.yandex.com/docs/iam/concepts/authorization/key) authentication is only supported: \* Create a [service account](https://cloud.yandex.com/docs/iam/concepts/users/service-accounts) in Yandex.Cloud: ```bash yc iam service-account create --name eso-service-account ``` \* Create an authorized key for the service account and save it to `authorized-key.json` file: ```bash yc iam key create \ --service-account-name eso-service-account \ --output authorized-key.json ``` \* Create a k8s secret containing the authorized key saved above: ```bash kubectl create secret generic yc-auth --from-file=authorized-key=authorized-key.json ``` \* Create a [SecretStore](../api/secretstore.md) pointing to `yc-auth` k8s secret: ```yaml apiVersion: external-secrets.io/v1 kind: SecretStore metadata: name: secret-store spec: provider: yandexcertificatemanager: auth: authorizedKeySecretRef: name: yc-auth key: authorized-key # Optionally, to enable fetching secrets by name: # # fetching: # place "fetching:" on the same level as "auth:" # byName: # folderId: \*\*\*\*\* # ID of the folder to fetch certificates from ``` \*\*NOTE:\*\* In case of a `ClusterSecretStore`, Be sure to provide `namespace` in all `authorizedKeySecretRef` with the namespace where the secret resides. ### Creating external secret To make External Secrets Operator sync a k8s secret with a Certificate Manager certificate: \* Create a Certificate Manager certificate (follow [the instructions](https://cloud.yandex.com/en-ru/docs/certificate-manager/operations/)), if not already created. \* Assign the [`certificate-manager.certificates.downloader`](https://cloud.yandex.com/en-ru/docs/certificate-manager/security/#roles-list) role for accessing the certificate content to the service account used for authentication (`\*\*\*\*\*` is the certificate ID): ```bash yc cm certificate add-access-binding \ --id \*\*\*\*\* \ --service-account-name eso-service-account \ --role certificate-manager.certificates.downloader ``` Run the following command to ensure that the correct access binding has been added: ```bash yc cm certificate list-access-bindings --id \*\*\*\*\* ``` \* Create an [ExternalSecret](../api/externalsecret.md) pointing to `secret-store` and the certificate in Certificate Manager: ```yaml apiVersion: external-secrets.io/v1 kind: ExternalSecret metadata: name: external-secret spec: refreshInterval: 1h0m0s secretStoreRef: name: secret-store kind: SecretStore target: name: k8s-secret # the target k8s secret name template: type: kubernetes.io/tls data: - secretKey: tls.crt # the target k8s secret key remoteRef: key: \*\*\*\*\* # either ID or name of the certificate, depending on fetching policy byID / byName property: chain - secretKey: tls.key # the target k8s secret key remoteRef: key: \*\*\*\*\* # either ID or name of the certificate, depending on fetching policy byID / byName property: privateKey ``` The following property values are possible: \* `chain` – to fetch PEM-encoded certificate chain \* `privateKey` – to fetch PEM-encoded private key \* `chainAndPrivateKey` or missing property – to fetch both chain and private key The operator will fetch the Yandex Certificate Manager certificate and inject it as a `Kind=Secret` ```yaml kubectl get secret k8s-secret -ojson | jq '."data"."tls.crt"' -r | base64 --decode kubectl get secret k8s-secret -ojson | jq '."data"."tls.key"' -r | base64 --decode ``` | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/yandex-certificate-manager.md | main | external-secrets | [
-0.08426864445209503,
-0.013801607303321362,
0.004209350794553757,
-0.02769615687429905,
0.010216801427304745,
-0.0016747876070439816,
0.07759695500135422,
-0.01338293869048357,
0.05711332708597183,
0.036254167556762695,
0.03640361130237579,
-0.030767470598220825,
0.08662194758653641,
0.05... | 0.042565 |
External Secrets Operator integrates with [Cloud.ru](https://cloud.ru) for secret management. Cloud.ru Secret Manager works in conjunction with the Key Manager cryptographic key management system to ensure secure encryption of secrets. ### Authentication \* Before you can use the Cloud.ru Secret Manager, you need to create a service account in the [Cloud.ru Console](https://console.cloud.ru). \* Create a [Service Account](https://cloud.ru/ru/docs/console\_api/ug/topics/guides\_\_service\_accounts\_create.html) and [Access Key](https://cloud.ru/ru/docs/console\_api/ug/topics/guides\_\_service\_accounts\_key.html) for it. \*\*NOTE:\*\* To interact with the SecretManager API, you need to use the access token. You can get it by running the following command, using the Access Key, created above: ```shell curl -i --data-urlencode 'grant\_type=access\_key' \ --data-urlencode "client\_id=$KEY\_ID" \ --data-urlencode "client\_secret=$SECRET" \ https://id.cloud.ru/auth/system/openid/token ``` ### Creating Cloud.ru secret To make External Secrets Operator sync a k8s secret with a Cloud.ru secret: \* Navigate to the [Cloud.ru Console](https://console.cloud.ru/). \* Click the menu at upper-left corner, scroll down to the `Management` section and click on `Secret Manager`. \* Click on `Create secret`. \* Fill in the secret name and secret value. \* Click on `Create`. Also, you can use [SecretManager API](https://cloud.ru/ru/docs/scsm/ug/topics/guides\_\_add-secret.html) to create the secret: ```shell curl --location 'https://secretmanager.api.cloud.ru/v1/secrets' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer ${ACCESS\_TOKEN}' \ --data '{ "description": "your secret description", "labels": { "env": "production" }, "name": "my\_first\_secret", "parent\_id": "50000000-4000-3000-2000-100000000001", "payload": { "data": { "value": "aGksIHRoZXJlJ3Mgbm90aGluZyBpbnRlcmVzdGluZyBoZXJlCg==" } } }' ``` \* `ACCESS\_TOKEN` is the access token for the Cloud.ru API. See \*\*Authentication\*\* section \* `parent\_id` parent service instance identifier: ServiceInstanceID. To get the ID value, in your personal account on the top left panel, click the Button with nine dots, select \*\*Management\*\* → \*\*Secret Manager\*\* and copy the value from the Service Instance ID field. \* `name` is the name of the secret. \* `description` is the description of the secret. \* `labels` are the labels(tags) for the secret. Is used in the search. \* `payload.data.value` is the base64-encoded secret value. \*\*NOTE:\*\* To create the Multi KeyValue secret in Cloud.ru, you can use the following format (json): ```json { "key1": "value1", "key2": "value2" } ``` ### Creating ExternalSecret \* Create the k8s Secret, it will be used for authentication in SecretStore: ```yaml apiVersion: v1 kind: Secret metadata: name: csm-secret labels: type: csm type: Opaque stringData: key\_id: '000000000000000000001' key\_secret: '000000000000000000002' ``` \* `key\_id` is the AccessKey key\_id. \* `key\_secret` is the AccessKey key\_secret \* Create a [SecretStore](../api/secretstore.md) pointing to `csm-secret` k8s Secret: ```yaml apiVersion: external-secrets.io/v1 kind: SecretStore metadata: name: csm spec: provider: cloudrusm: auth: secretRef: accessKeyIDSecretRef: name: csm-secret key: key\_id accessKeySecretSecretRef: name: csm-secret key: key\_secret projectID: 50000000-4000-3000-2000-100000000001 ``` \* `accessKeyIDSecretRef` is the reference to the k8s Secret with the AccessKey. \* `projectID` is the project identifier. To get the project id value, in your personal account on the top left, click on project name, In the opening window, click at 3 points next to the name of the necessary project, then the button "Copy the Project ID". #### Create an [ExternalSecret](../api/externalsecret.md) pointing to SecretStore. \* Classic, non-json: ```yaml apiVersion: external-secrets.io/v1 kind: ExternalSecret metadata: name: csm-ext-secret spec: refreshInterval: 10s secretStoreRef: name: csm kind: SecretStore target: name: my-awesome-secret creationPolicy: Owner data: - secretKey: target\_key remoteRef: key: my\_first\_secret # or you can use the secret.id (e.g. 50000000-4000-3000-2000-100000000001) ``` \* From Multi KeyValue, value MUST be in \*\*json format\*\*: NOTE: You can use \*either\* `name` or `tags` to filter the secrets. Here are basic examples of both: ```yaml apiVersion: external-secrets.io/v1 kind: ExternalSecret metadata: name: csm-ext-secret spec: refreshInterval: 10s secretStoreRef: name: csm kind: SecretStore target: name: my-awesome-secret creationPolicy: Owner data: - secretKey: target\_key remoteRef: key: my\_first\_secret # or you can use the secret.id (e.g. 50000000-4000-3000-2000-100000000001) property: cloudru.secret.key # is the JSON path for the key in the secret value. ``` \* With all fields, | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/cloudru.md | main | external-secrets | [
-0.06282803416252136,
-0.043332528322935104,
-0.0823478177189827,
0.049960918724536896,
-0.007124601863324642,
0.017924033105373383,
0.03458177670836449,
0.02746211551129818,
0.07706449180841446,
0.07461189478635788,
0.008086985908448696,
-0.014962909743189812,
0.04387852922081947,
-0.0004... | 0.088908 |
name: csm-ext-secret spec: refreshInterval: 10s secretStoreRef: name: csm kind: SecretStore target: name: my-awesome-secret creationPolicy: Owner data: - secretKey: target\_key remoteRef: key: my\_first\_secret # or you can use the secret.id (e.g. 50000000-4000-3000-2000-100000000001) property: cloudru.secret.key # is the JSON path for the key in the secret value. ``` \* With all fields, value MUST be in \*\*json format\*\*: ```yaml apiVersion: external-secrets.io/v1 kind: ExternalSecret metadata: name: csm-ext-secret spec: refreshInterval: 10s secretStoreRef: name: csm kind: SecretStore target: name: my-awesome-secret creationPolicy: Owner dataFrom: - extract: key: my\_first\_secret # or you can use the secret.id (e.g. 50000000-4000-3000-2000-100000000001) ``` \* Search the secrets by the Name or Labels (tags): ```yaml apiVersion: external-secrets.io/v1 kind: ExternalSecret metadata: name: csm-ext-secret spec: refreshInterval: 10s secretStoreRef: name: csm kind: SecretStore target: name: my-awesome-secret creationPolicy: Owner dataFrom: - find: # You can use the name and tags separately or together to search for secrets. tags: env: production name: regexp: "my.\*secret" ``` | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/cloudru.md | main | external-secrets | [
-0.05505150929093361,
0.023349372670054436,
-0.034951772540807724,
0.053448326885700226,
0.01922697015106678,
-0.017212849110364914,
0.03591230511665344,
0.04845896735787392,
0.08113238215446472,
0.053385596722364426,
0.07022448629140854,
-0.114031583070755,
0.041236087679862976,
-0.030734... | -0.012475 |
## AWS Authentication ### Controller's Pod Identity  Note: If you are using Parameter Store replace `service: SecretsManager` with `service: ParameterStore` in all examples below. This is basically a zero-configuration authentication method that inherits the credentials from the runtime environment using the [aws sdk default credential chain](https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/credentials.html#credentials-default). You can attach a role to the pod using [IRSA](https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html), [kiam](https://github.com/uswitch/kiam) or [kube2iam](https://github.com/jtblin/kube2iam). When no other authentication method is configured in the `Kind=Secretstore` this role is used to make all API calls against AWS Secrets Manager or SSM Parameter Store. Based on the Pod's identity you can do a `sts:assumeRole` before fetching the secrets to limit access to certain keys in your provider. This is optional. ```yaml apiVersion: external-secrets.io/v1 kind: SecretStore metadata: name: team-b-store spec: provider: aws: service: SecretsManager region: eu-central-1 # optional: do a sts:assumeRole before fetching secrets role: team-b ``` ### Access Key ID & Secret Access Key  You can store Access Key ID & Secret Access Key in a `Kind=Secret` and reference it from a SecretStore. ```yaml apiVersion: external-secrets.io/v1 kind: SecretStore metadata: name: team-b-store spec: provider: aws: service: SecretsManager region: eu-central-1 # optional: assume role before fetching secrets role: team-b auth: secretRef: accessKeyIDSecretRef: name: awssm-secret key: access-key secretAccessKeySecretRef: name: awssm-secret key: secret-access-key ``` \*\*NOTE:\*\* In case of a `ClusterSecretStore`, Be sure to provide `namespace` in `accessKeyIDSecretRef`, `secretAccessKeySecretRef` with the namespaces where the secrets reside. ### EKS Service Account credentials  This feature lets you use short-lived service account tokens to authenticate with AWS. You must have [Service Account Volume Projection](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#service-account-token-volume-projection) enabled - it is by default on EKS. See [EKS guide](https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts-technical-overview.html) on how to set up IAM roles for service accounts. The big advantage of this approach is that ESO runs without any credentials. ```yaml apiVersion: v1 kind: ServiceAccount metadata: annotations: eks.amazonaws.com/role-arn: arn:aws:iam::123456789012:role/team-a name: my-serviceaccount namespace: default ``` Reference the service account from above in the Secret Store: ```yaml apiVersion: external-secrets.io/v1 kind: SecretStore metadata: name: secretstore-sample spec: provider: aws: service: SecretsManager region: eu-central-1 auth: jwt: serviceAccountRef: name: my-serviceaccount ``` \*\*NOTE:\*\* In case of a `ClusterSecretStore`, Be sure to provide `namespace` for `serviceAccountRef` with the namespace where the service account resides. ## EKS Pod Identity Setup In order to use EKS Pod Identity Agent, create a role like this: ```json { "Statement": [ { "Action": [ "secretsmanager:GetResourcePolicy", "secretsmanager:GetSecretValue", "secretsmanager:DescribeSecret", "secretsmanager:ListSecretVersionIds" ], "Effect": "Allow", "Resource": [ "\*" ] } ], "Version": "2012-10-17" } ``` ```json { "Version": "2012-10-17", "Statement": [ { "Sid": "AllowEksAuthToAssumeRoleForPodIdentity", "Effect": "Allow", "Principal": { "Service": "pods.eks.amazonaws.com" }, "Action": [ "sts:AssumeRole", "sts:TagSession" ] } ] } ``` Install ESO using helm and define these values: ```yaml serviceAccount: annotations: name: external-secrets ``` Create a pod association: ``` aws eks create-pod-identity-association --cluster-name my-cluster --role-arn arn:aws:iam::111122223333:role/my-role --namespace external-secrets --service-account external-secrets ``` Then create a secret store like this: ```yaml apiVersion: external-secrets.io/v1 kind: SecretStore metadata: name: store spec: provider: aws: service: SecretsManager region: eu-central-1 ``` \_Note\_: `serviceAccountRef` \_cannot\_ be used together with EKS Pod Identity. That's because ESO can not impersonate service accounts which have iam roles bound using pod identity. Doing so will result in an error like this: ``` unable to create session: an IAM role must be associated with service account ... ``` \_Note:\_ No `auth` section is defined for the SecretStore. \_Note:\_ For even more details you can follow this post for more setup and information using Terraform [here](https://containscloud.com/2024/03/24/integrating-aws-secrets-manager-to-eks-using-external-secrets/). ## Custom Endpoints You can define custom AWS endpoints if you want to use regional, vpc or custom endpoints. See List of endpoints for [Secrets Manager](https://docs.aws.amazon.com/general/latest/gr/asm.html), [Secure Systems Manager](https://docs.aws.amazon.com/general/latest/gr/ssm.html) and [Security Token Service](https://docs.aws.amazon.com/general/latest/gr/sts.html). Use the following environment variables to point the controller to your custom endpoints. Note: | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/aws-access.md | main | external-secrets | [
-0.024052122607827187,
0.03964386507868767,
-0.035123154520988464,
-0.002759370720013976,
-0.010259772650897503,
0.013808811083436012,
0.0275490153580904,
0.020857209339737892,
0.06913773715496063,
0.05535639822483063,
0.010437953285872936,
-0.046401575207710266,
0.08498277515172958,
-0.00... | 0.084667 |
using Terraform [here](https://containscloud.com/2024/03/24/integrating-aws-secrets-manager-to-eks-using-external-secrets/). ## Custom Endpoints You can define custom AWS endpoints if you want to use regional, vpc or custom endpoints. See List of endpoints for [Secrets Manager](https://docs.aws.amazon.com/general/latest/gr/asm.html), [Secure Systems Manager](https://docs.aws.amazon.com/general/latest/gr/ssm.html) and [Security Token Service](https://docs.aws.amazon.com/general/latest/gr/sts.html). Use the following environment variables to point the controller to your custom endpoints. Note: All resources managed by this controller are affected. | ENV VAR | DESCRIPTION | | --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | AWS\_SECRETSMANAGER\_ENDPOINT | Endpoint for the Secrets Manager Service. The controller uses this endpoint to fetch secrets from AWS Secrets Manager. | | AWS\_SSM\_ENDPOINT | Endpoint for the AWS Secure Systems Manager. The controller uses this endpoint to fetch secrets from SSM Parameter Store. | | AWS\_STS\_ENDPOINT | Endpoint for the Security Token Service. The controller uses this endpoint when creating a session and when doing `assumeRole` or `assumeRoleWithWebIdentity` calls. | | AWS\_ECR\_ENDPOINT | Endpoint for the ECR Service. The controller uses this endpoint to fetch authorization tokens from ECR. | | AWS\_ECR\_PUBLIC\_ENDPOINT | Endpoint for the Public ECR Service. The controller uses this endpoint to fetch authorization tokens from ECR. | | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/aws-access.md | main | external-secrets | [
-0.025385284796357155,
0.0278572179377079,
-0.05179740488529205,
0.04997868463397026,
-0.0120585598051548,
0.016157137230038643,
0.0028904613573104143,
-0.024588633328676224,
0.07054339349269867,
0.08794942498207092,
0.0028182112146168947,
-0.05843295902013779,
0.06789256632328033,
-0.0232... | 0.068281 |
## Generic Webhook External Secrets Operator can integrate with simple web apis by specifying the endpoint ### Example First, create a SecretStore with a webhook backend. We'll use a static user/password `test`: ```yaml {% raw %} apiVersion: external-secrets.io/v1 kind: SecretStore metadata: name: webhook-backend spec: provider: webhook: url: "http://httpbin.org/get?parameter={{ .remoteRef.key }}" result: jsonPath: "$.args.parameter" headers: Content-Type: application/json Authorization: Basic {{ print .auth.username ":" .auth.password | b64enc }} secrets: - name: auth secretRef: name: webhook-credentials {%- endraw %} --- apiVersion: v1 kind: Secret metadata: name: webhook-credentials labels: external-secrets.io/type: webhook #Needed to allow webhook to use this secret data: username: dGVzdA== # "test" password: dGVzdA== # "test" ``` NB: This is obviously not practical because it just returns the key as the result, but it shows how it works \*\*NOTE:\*\* In case of a `ClusterSecretStore`, Be sure to provide `namespace` in all `secrets` references with the namespaces where the secrets reside. Now create an ExternalSecret that uses the above SecretStore: ```yaml apiVersion: external-secrets.io/v1 kind: ExternalSecret metadata: name: webhook-example spec: refreshInterval: "15s" secretStoreRef: name: webhook-backend kind: SecretStore target: name: example-sync data: - secretKey: foobar remoteRef: key: secret --- # will create a secret with: kind: Secret metadata: name: example-sync data: foobar: c2VjcmV0 ``` #### Push secret To push a secret, create the following store: ```yaml {% raw %} apiVersion: external-secrets.io/v1 kind: SecretStore metadata: name: webhook-backend spec: provider: webhook: url: "http://httpbin.org/push?id={{ .remoteRef.remoteKey }}&secret={{ .remoteRef.secretKey }}" body: '{"secret-field": "{{ index .remoteRef .remoteRef.remoteKey }}"}' headers: Content-Type: application/json Authorization: Basic {{ print .auth.username ":" .auth.password | b64enc }} secrets: - name: auth secretRef: name: webhook-credentials {%- endraw %} ``` Then create a push secret: ```yaml apiVersion: external-secrets.io/v1alpha1 kind: PushSecret metadata: name: pushsecret-example # Customisable spec: refreshInterval: 1h0m0s # Refresh interval for which push secret will reconcile secretStoreRefs: # A list of secret stores to push secrets to - name: webhook-backend kind: SecretStore selector: secret: name: test-secret data: - conversionStrategy: match: secretKey: testsecret remoteRef: remoteKey: remotekey ``` If `secretKey` is not provided, the whole secret is provided JSON encoded. The secret will be added to the `remoteRef` object so that it is retrievable in the templating engine. The secret will be sent in the body when the body field of the provider is empty. In the rare case that the body should be empty, the provider can be configured to use `{% raw %}'{{ "" }}'{% endraw %}` for the body value. #### Authentication Webhook also supports using NTLM for authorization: ```yaml {% raw %} apiVersion: external-secrets.io/v1 kind: SecretStore metadata: name: webhook-backend spec: provider: webhook: url: "http://httpbin.org/get?parameter={{ .remoteRef.key }}" result: jsonPath: "$.args.parameter" auth: ntlm: usernameSecret: name: webhook-credentials key: username namespace: externalsecrets passwordSecret: name: webhook-credentials key: password namespace: externalsecrets {%- endraw %} --- apiVersion: v1 kind: Secret metadata: name: webhook-credentials namespace: externalsecrets data: username: dGVzdA== # "test" password: dGVzdA== # "test" ``` !!! note If a webhook endpoint for a given `ExternalSecret` returns a 404 status code, the secret is considered to have been deleted. This will trigger the `deletionPolicy` set on the `ExternalSecret`. ### Templating Generic WebHook provider uses the templating engine to generate the API call. It can be used in the url, headers, body and result.jsonPath fields. The provider inserts the secret to be retrieved in the object named `remoteRef`. In addition, secrets can be added as named objects, for example to use in authorization headers. Each secret has a `name` property which determines the name of the object in the templating engine. ### All Parameters ```yaml apiVersion: external-secrets.io/v1 kind: ClusterSecretStore metadata: name: statervault spec: provider: webhook: # Url to call. Use templating engine to fill in the request parameters url: # http method, defaults to GET | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/webhook.md | main | external-secrets | [
-0.1160898208618164,
0.0851995199918747,
-0.09523461014032364,
0.01853214204311371,
-0.021119168028235435,
-0.06030756235122681,
-0.03728935122489929,
0.03334025293588638,
-0.029359200969338417,
0.010344692505896091,
0.012748458422720432,
-0.08080727607011795,
0.0143418675288558,
-0.008929... | 0.021534 |
secret has a `name` property which determines the name of the object in the templating engine. ### All Parameters ```yaml apiVersion: external-secrets.io/v1 kind: ClusterSecretStore metadata: name: statervault spec: provider: webhook: # Url to call. Use templating engine to fill in the request parameters url: # http method, defaults to GET method: # Timeout in duration (1s, 1m, etc) timeout: 1s result: # [jsonPath](https://jsonpath.com) syntax, which also can be templated jsonPath: # Map of headers, can be templated headers: : # Body to sent as request, can be templated (optional) body: # List of secrets to expose to the templating engine secrets: # Use this name to refer to this secret in templating, above - name: secretRef: namespace: # Only used in ClusterSecretStores name: # Add CAs here for the TLS handshake caBundle: caProvider: type: Secret or ConfigMap name: namespace: # Only used in ClusterSecretStores key: ``` ### Webhook as generators You can also leverage webhooks as generators, following the same syntax. The only difference is that the webhook generator needs its source secrets to be labeled, as opposed to webhook secretstores. Please see the [generator-webhook](../api/generator/webhook.md) documentation for more information. | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/webhook.md | main | external-secrets | [
-0.12162091583013535,
0.1170082539319992,
-0.045006245374679565,
0.03927777707576752,
0.035106196999549866,
-0.028924081474542618,
-0.061822935938835144,
0.027822447940707207,
0.06324336677789688,
-0.013076438568532467,
0.008654698729515076,
-0.10161659121513367,
-0.010669179260730743,
-0.... | 0.191346 |
 ## Parameter Store A `ParameterStore` points to AWS SSM Parameter Store in a certain account within a defined region. You should define Roles that define fine-grained access to individual secrets and pass them to ESO using `spec.provider.aws.role`. This way users of the `SecretStore` can only access the secrets necessary. ``` yaml {% include 'aws-parameter-store.yaml' %} ``` \*\*NOTE:\*\* In case of a `ClusterSecretStore`, Be sure to provide `namespace` in `accessKeyIDSecretRef` and `secretAccessKeySecretRef` with the namespaces where the secrets reside. !!! warning "API Pricing & Throttling" The SSM Parameter Store API is charged by throughput and is available in different tiers, [see pricing](https://aws.amazon.com/systems-manager/pricing/#Parameter\_Store). Please estimate your costs before using ESO. Cost depends on the RefreshInterval of your ExternalSecrets. ### IAM Policy #### Fetching Parameters The example policy below shows the minimum required permissions for fetching SSM parameters. This policy permits pinning down access to secrets with a path matching `dev-\*`. Other operations may require additional permission. For example, finding parameters based on tags will also require `ssm:DescribeParameters` and `tag:GetResources` permission with `"Resource": "\*"`. Generally, the specific permission required will be logged as an error if an operation fails. For further information see [AWS Documentation](https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-paramstore-access.html). ``` json { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "ssm:GetParameter\*", ], "Resource": "arn:aws:ssm:us-east-2:1234567889911:parameter/dev-\*" } ] } ``` #### Pushing Parameters The example policy below shows the minimum required permissions for pushing SSM parameters. Like with the fetching policy it restricts the path in which it can push secrets too. ``` json { "Action": [ "ssm:GetParameter\*", "ssm:PutParameter\*", "ssm:AddTagsToResource", "ssm:ListTagsForResource" ], "Effect": "Allow", "Resource": "arn:aws:ssm:us-east-2:1234567889911:parameter/dev-\*" } ``` ### JSON Secret Values You can store JSON objects in a parameter. You can access nested values or arrays using [gjson syntax](https://github.com/tidwall/gjson/blob/master/SYNTAX.md): Consider the following JSON object that is stored in the Parameter Store key `friendslist`: ``` json { "name": {"first": "Tom", "last": "Anderson"}, "friends": [ {"first": "Dale", "last": "Murphy"}, {"first": "Roger", "last": "Craig"}, {"first": "Jane", "last": "Murphy"} ] } ``` This is an example on how you would look up nested keys in the above json object: ``` yaml apiVersion: external-secrets.io/v1 kind: ExternalSecret metadata: name: extract-data spec: # [omitted for brevity] data: - secretKey: my\_name remoteRef: key: friendslist property: name.first # Tom - secretKey: first\_friend remoteRef: key: friendslist property: friends.1.first # Roger # metadataPolicy to fetch all the tags in JSON format - secretKey: tags remoteRef: metadataPolicy: Fetch key: database-credentials # metadataPolicy to fetch a specific tag (dev) from the source secret - secretKey: developer remoteRef: metadataPolicy: Fetch key: database-credentials property: dev ``` ### Parameter Versions ParameterStore creates a new version of a parameter every time it is updated with a new value. The parameter can be referenced via the `version` property ## SetSecret The SetSecret method for the Parameter Store allows the user to set the value stored within the Kubernetes cluster to the remote AWS Parameter Store. ### Creating a Push Secret ```yaml {% include "full-pushsecret.yaml" %} ``` #### Additional Metadata for PushSecret Optionally, it is possible to configure additional options for the parameter. These are as follows: - type - keyID - tier & policies - encodeAsDecoded To control this behaviour you can set the following provider's `metadata`: ```yaml {% include 'aws-pm-push-secret-with-metadata.yaml' %} ``` - `secretType` takes three options. `String`, `StringList`, and `SecureString`, where `String` is the \_default\_ - `kmsKeyID` takes a KMS Key `$ID` or `$ARN` (in case a key source is created in another account) as a string, where `alias/aws/ssm` is the \_default\_. This property is only used if `secretType` is set as `SecureString`. - tier & policies contains advanced policy configs such as `ExpirationNotification`. - encodeAsDecoded if set to true will | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/aws-parameter-store.md | main | external-secrets | [
0.0177497286349535,
0.021423591300845146,
-0.07930678874254227,
0.08338481187820435,
0.01021943986415863,
0.01661115512251854,
-0.019177457317709923,
0.02932240627706051,
0.01705237850546837,
0.05951467528939247,
0.038990918546915054,
-0.06206902489066124,
0.11445032060146332,
-0.056193362... | 0.047114 |
`$ID` or `$ARN` (in case a key source is created in another account) as a string, where `alias/aws/ssm` is the \_default\_. This property is only used if `secretType` is set as `SecureString`. - tier & policies contains advanced policy configs such as `ExpirationNotification`. - encodeAsDecoded if set to true will get the secrets and push them as plain values when pushing the entire secret (instead of encoding them) instead of base64 encoding the []byte values from the secret. #### Check successful secret sync To be able to check that the secret has been successfully synced you can run the following command: ```bash kubectl get pushsecret pushsecret-example ``` If the secret has synced successfully it will show the status as "Synced". #### Test new secret using AWS CLI To View your parameter on AWS Parameter Store using the AWS CLI, install and login to the AWS CLI using the following guide: [AWS CLI](https://aws.amazon.com/cli/). Run the following commands to get your synchronized parameter from AWS Parameter Store: ```bash aws ssm get-parameter --name=my-first-parameter --region=us-east-1 ``` You should see something similar to the following output: ```json { "Parameter": { "Name": "my-first-parameter", "Type": "String", "Value": "charmander", "Version": 4, "LastModifiedDate": "2022-09-15T13:04:31.098000-03:00", "ARN": "arn:aws:ssm:us-east-1:1234567890123:parameter/my-first-parameter", "DataType": "text" } } ``` --8<-- "snippets/provider-aws-access.md" | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/aws-parameter-store.md | main | external-secrets | [
-0.040175069123506546,
-0.02718471735715866,
-0.06567937880754471,
0.013958065770566463,
-0.027184344828128815,
0.03127492964267731,
-0.00471052760258317,
-0.06687068939208984,
0.09449493885040283,
0.03365827724337578,
0.0179661363363266,
-0.09586441516876221,
0.06905543804168701,
-0.07011... | 0.022429 |
## ngrok External Secrets Operator integrates with [ngrok](https://ngrok.com/) to sync Kubernetes secrets with [ngrok Secrets for Traffic Policy](https://ngrok.com/blog-post/secrets-for-traffic-policy). Currently, only pushing secrets is supported. ### Configuring ngrok Provider Verify that `ngrok` provider is listed in the `Kind=SecretStore`. The properties `vault` and `auth` are required. The `apiURL` is optional and defaults to `https://api.ngrok.com`. ```yaml {% include 'ngrok-secret-store.yaml' %} ``` ### Pushing secrets to ngrok To sync a Kubernetes secret with an external ngrok secret we need to create a PushSecret, this means a `Kind=PushSecret` is needed. ```yaml {% include 'ngrok-push-secret.yaml' %}: ``` #### PushSecret Metadata Additionally, you can control the description and metadata of the secret in ngrok like so: ```yaml {% include 'ngrok-push-secret-with-metadata.yaml' %} ``` | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/ngrok.md | main | external-secrets | [
-0.1214267686009407,
-0.05310382694005966,
-0.010177615098655224,
-0.011452075093984604,
-0.07999242842197418,
0.0003709146403707564,
-0.04183947294950485,
0.03149007260799408,
-0.0016755257965996861,
0.06529826670885086,
0.03317353129386902,
-0.0648423284292221,
-0.03969559818506241,
0.01... | 0.068778 |
# Volcengine Provider ## Quick start This guide demonstrates how to use the Volcengine (BytePlus) provider. ### Step 1 Create a secret in the [Volcengine KMS](https://console.volcengine.com/kms). ### Step 2 Create a `SecretStore`. #### Case 1: IRSA is not enabled You need to provide a Kubernetes `Secret` containing the credentials (Access Key ID, Secret Access Key and STS token) for accessing Volcengine KMS. ```yaml apiVersion: v1 kind: Secret metadata: name: volcengine-creds type: Opaque data: accessKeyID: YOUR\_ACCESS\_KEY\_ID\_IN\_BASE64 secretAccessKey: YOUR\_SECRET\_ACCESS\_KEY\_IN\_BASE64 sts-token: YOUR\_STS\_TOKEN\_IN\_BASE64 # Optional --- apiVersion: external-secrets.io/v1 kind: SecretStore metadata: name: volcengine-kms spec: provider: volcengine: # Region (Required) region: "cn-beijing" auth: secretRef: accessKeyID: name: volcengine-creds key: accessKeyID secretAccessKey: name: volcengine-creds key: secretAccessKey # (Optional, provide the Secret reference for the STS token if you are using one) token: name: volcengine-creds key: sts-token ``` #### Case 2: IRSA is enabled When the `auth` block is not specified or does not contain secretRef, IRSA is enabled by default. ```yaml apiVersion: external-secrets.io/v1 kind: SecretStore metadata: name: volcengine-kms spec: provider: volcengine: # Region (Required) region: "cn-beijing" ``` Add service account and environment variables in helm `values.yaml` as below to enable IRSA. ```yaml # Environment variables of external-secrets Pod extraEnv: - name: VOLCENGINE\_OIDC\_ROLE\_TRN value: "YOUR\_ROLE\_TRN" - name: VOLCENGINE\_OIDC\_TOKEN\_FILE value: "/var/run/secrets/vke.volcengine.com/irsa-tokens/token" # Volume mounts of external-secrets Pod extraVolumeMounts: - mountPath: /var/run/secrets/vke.volcengine.com/irsa-tokens name: irsa-oidc-token readOnly: true extraVolumes: - name: irsa-oidc-token projected: defaultMode: 420 sources: - serviceAccountToken: audience: sts.volcengine.com expirationSeconds: 3600 path: token # Service account of external-secrets Pod serviceAccount: name: "YOUR\_SERVICE\_ACCOUNT\_NAME" ``` Note: - Ensure that your role has the permission `KMSFullAccess` . ### Step 3 Create `ExternalSecret`. #### Case 1: Get the entire Secret (JSON format) from the secret manager and extract a single property ```yaml apiVersion: external-secrets.io/v1 kind: ExternalSecret metadata: name: my-app-secret spec: secretStoreRef: name: volcengine-kms kind: SecretStore target: name: db-credentials data: - secretKey: password remoteRef: key: "my-app/db/credentials" # The name of the secret in the secret manager property: "password" # The field name in the JSON ``` #### Case 2: Do not specify a property, get the entire Secret from the secret manager and sync all its key-value pairs ```yaml apiVersion: external-secrets.io/v1 kind: ExternalSecret metadata: name: my-app-secret spec: secretStoreRef: name: volcengine-kms kind: SecretStore target: name: db-credentials data: - secretKey: password remoteRef: key: "my-app/db/credentials" # The name of the secret in the secret manager ``` | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/volcengine.md | main | external-secrets | [
-0.07499253004789352,
0.03421299159526825,
-0.03534841164946556,
-0.04160809889435768,
-0.08876047283411026,
0.02635921537876129,
0.0036553330719470978,
0.040109939873218536,
0.04189452528953552,
0.041461821645498276,
0.0237723458558321,
-0.07037840783596039,
-0.021384062245488167,
-0.0185... | 0.096879 |
 ## Doppler SecretOps Platform Sync secrets from the [Doppler SecretOps Platform](https://www.doppler.com/) to Kubernetes using the External Secrets Operator. ## Authentication Doppler supports two authentication methods: > \*\*NOTE:\*\* When using a `ClusterSecretStore`, be sure to set `namespace` in `secretRef.dopplerToken` (for token auth) or `serviceAccountRef` (for OIDC auth). ### Service Token Authentication Doppler [Service Tokens](https://docs.doppler.com/docs/service-tokens) are recommended as they restrict access to a single config.  > NOTE: Doppler Personal Tokens are also supported but require `project` and `config` to be set on the `SecretStore` or `ClusterSecretStore`. Create the Doppler Token secret by opening the Doppler dashboard and navigating to the desired Project and Config, then create a new Service Token from the \*\*Access\*\* tab:  Create the Doppler Token Kubernetes secret with your Service Token value: ```sh HISTIGNORE='\*kubectl\*' kubectl create secret generic \ doppler-token-auth-api \ --from-literal dopplerToken="dp.st.xxxx" ``` Then to create a generic `SecretStore`: ```yaml {% include 'doppler-generic-secret-store.yaml' %} ``` ### OIDC Authentication For OIDC authentication, you'll need to configure a Doppler [Service Account Identity](https://docs.doppler.com/docs/service-account-identities) and create a Kubernetes ServiceAccount. First, create a Kubernetes ServiceAccount: ```yaml apiVersion: v1 kind: ServiceAccount metadata: name: doppler-oidc-sa namespace: external-secrets ``` Next, create a Doppler Service Account Identity with: - \*\*Issuer\*\*: Your cluster's OIDC discovery URL - \*\*Audience\*\*: The resource-specific audience for the SecretStore (`secretStore::` or `clusterSecretStore:`), e.g. `secretStore:external-secrets:doppler-oidc-sa` or `clusterSecretStore:doppler-auth-api` - \*\*Subject\*\*: The Kubernetes ServiceAccount (`system:serviceaccount::`), e.g. `system:serviceaccount:external-secrets:doppler-oidc-sa` Then configure the SecretStore: ```yaml {% include 'doppler-oidc-secret-store.yaml' %} ``` ## Use Cases The Doppler provider allows for a wide range of use cases: 1. [Fetch](#1-fetch) 2. [Fetch all](#2-fetch-all) 3. [Filter](#3-filter) 4. [JSON secret](#4-json-secret) 5. [Name transformer](#5-name-transformer) 6. [Download](#6-download) Let's explore each use case using a fictional `auth-api` Doppler project. ## 1. Fetch To sync one or more individual secrets: ``` yaml {% include 'doppler-fetch-secret.yaml' %} ```  ## 2. Fetch all To sync every secret from a config: ``` yaml {% include 'doppler-fetch-all-secrets.yaml' %} ```  ## 3. Filter To filter secrets by `path` (path prefix), `name` (regular expression) or a combination of both: ``` yaml {% include 'doppler-filtered-secrets.yaml' %} ```  ## 4. JSON secret To parse a JSON secret to its key-value pairs: ``` yaml {% include 'doppler-parse-json-secret.yaml' %} ```  ## 5. Name transformer Name transformers format keys from Doppler's UPPER\_SNAKE\_CASE to one of the following alternatives: - upper-camel - camel - lower-snake - tf-var - dotnet-env - lower-kebab Name transformers require a specifically configured `SecretStore`: ```yaml {% include 'doppler-name-transformer-secret-store.yaml' %} ``` Then an `ExternalSecret` referencing the `SecretStore`: ```yaml {% include 'doppler-name-transformer-external-secret.yaml' %} ```  ### 6. Download A single `DOPPLER\_SECRETS\_FILE` key is set where the value is the secrets downloaded in one of the following formats: - json - dotnet-json - env - env-no-quotes - yaml Downloading secrets requires a specifically configured `SecretStore`: ```yaml {% include 'doppler-secrets-download-secret-store.yaml' %} ``` Then an `ExternalSecret` referencing the `SecretStore`: ```yaml {% include 'doppler-secrets-download-external-secret.yaml' %} ```  | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/doppler.md | main | external-secrets | [
-0.08386103063821793,
-0.01849289983510971,
0.01001744531095028,
0.010533775202929974,
0.02090897411108017,
-0.06753453612327576,
0.023354392498731613,
0.02653856761753559,
0.09519979357719421,
0.0034074883442372084,
-0.0063089290633797646,
-0.03762917220592499,
0.028799166902899742,
-0.03... | 0.106038 |
We provide a `fake` implementation to help with testing. This provider returns static key/value pairs and nothing else. To use the `fake` provider simply create a `SecretStore` or `ClusterSecretStore` and configure it like in the following example: !!! note inline end The provider returns static data configured in `value`. You can define a `version`, too. If set the `remoteRef` from an ExternalSecret must match otherwise no value is returned. ```yaml {% include 'fake-provider-store.yaml' %} ``` Please note that `value` is intended for exclusive use with `data` for `dataFrom`. You can use the `data` to set a `JSON` compliant value to be used as `dataFrom`. Here is an example `ExternalSecret` that displays this behavior: !!! warning inline end This provider supports specifying different `data[].version` configurations. However, `data[].property` is ignored. ```yaml {% include 'fake-provider-es.yaml' %} ``` This results in the following secret: ```yaml {% include 'fake-provider-secret.yaml' %} ``` | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/fake.md | main | external-secrets | [
-0.06514455378055573,
0.020827950909733772,
-0.01901692897081375,
0.05090521648526192,
-0.007570534944534302,
-0.061396729201078415,
-0.015857968479394913,
0.024833984673023224,
0.01599246822297573,
0.011894900351762772,
0.10326667129993439,
-0.04500363767147064,
0.07182924449443817,
0.001... | 0.069551 |
External Secrets Operator integrates with the [Google Cloud Secret Manager](https://cloud.google.com/secret-manager). ## Authentication ### Workload Identity Federation Through [Workload Identity Federation](https://cloud.google.com/kubernetes-engine/docs/concepts/workload-identity) (WIF), platforms that support workload identity (GKE, non-GKE kubernetes clusters, on-premise clusters) can authenticate with Google Cloud Platform (GCP) services like Secret Manager without using static, long-lived credentials. Authenticating through WIF is the recommended approach when using the External Secrets Operator (ESO). ESO supports three options: - \*\*Using a Kubernetes service account as a GCP IAM principal\*\*: The `SecretStore` (or `ClusterSecretStore`) references a [Kubernetes service account](https://kubernetes.io/docs/concepts/security/service-accounts) that is authorized to access Secret Manager secrets. - \*\*Linking a Kubernetes service account to a GCP service account:\*\* The `SecretStore` (or `ClusterSecretStore`) references a Kubernetes service account, which is linked to a [GCP service account](https://cloud.google.com/iam/docs/service-accounts) that is authorized to access Secret Manager secrets. This requires that the Kubernetes service account is annotated correctly and granted the `iam.workloadIdentityUser` role on the GCP service account. - \*\*Authorizing the Core Controller Pod:\*\* The ESO Core Controller Pod's service account is authorized to access Secret Manager secrets. No authentication is required for `SecretStore` and `ClusterSecretStore` instances. In the following, we will describe each of these options in detail. #### Prerequisites \* Ensure that [Workload Identity Federation is enabled](https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity) for the cluster. \_Note that Google Cloud WIF [is available for AKS, EKS, and self-hosted Kubernetes clusters](https://cloud.google.com/iam/docs/workload-identity-federation-with-kubernetes). ESO previously only supported WIF authentication for GKE ([Issue #1038](https://github.com/external-secrets/external-secrets/issues/1038)); however, support has been added for [GCP Workload Identity Federation](https://github.com/external-secrets/external-secrets/pull/4654).\_ #### Using a Kubernetes service account as a GCP IAM principal The `SecretStore` (or `ClusterSecretStore`) references a Kubernetes service account that is authorized to access Secret Manager secrets. To demonstrate this approach, we'll create a `SecretStore` in the `demo` namespace. First, create a Kubernetes service account in the `demo` namespace: ```yaml apiVersion: v1 kind: ServiceAccount metadata: name: demo-secrets-sa namespace: demo ``` To grant a Kubernetes service account access to Secret Manager secret(s), you need to know four values: \* `PROJECT\_ID`: Your GCP project ID, which you can find under "Project Info" on your console dashboard. Note that this might be different from your project's \_name\_. \* `PROJECT\_NUMBER`: Your GCP project number, which you can find under "Project Info" on your console dashboard or through `gcloud projects describe $PROJECT\_ID --format="value(projectNumber)"`. \* `K8S\_SA`: The name of the Kubernetes service account you created. (In our example, `demo-secrets-sa`.) \* `K8S\_NAMESPACE`: The namespace where you created the Kubernetes service account (In our example, `demo`.) For example, the following CLI call grants the Kubernetes service account access to a secret `demo-secret`: ```shell gcloud secrets add-iam-policy-binding demo-secret \ --project=$PROJECT\_ID \ --role="roles/secretmanager.secretAccessor" \ --member="principal://iam.googleapis.com/projects/${PROJECT\_NUMBER}/locations/global/workloadIdentityPools/${PROJECT\_ID}.svc.id.goog/subject/ns/${K8S\_NAMESPACE}/sa/${K8S\_SA}" ``` You can also grant the Kubernetes service account access to \_all\_ secrets in a GCP project: ```shell gcloud projects add-iam-policy-binding $PROJECT\_ID \ --role="roles/secretmanager.secretAccessor" \ --member="principal://iam.googleapis.com/projects/${PROJECT\_NUMBER}/locations/global/workloadIdentityPools/${PROJECT\_ID}.svc.id.goog/subject/ns/${K8S\_NAMESPACE}/sa/${K8S\_SA}" ``` Note that this allows anyone who can create `ExternalSecret` resources referencing a `SecretStore` instance using this service account access to all secrets in the project. \_For more information about WIF and Secret Manager permissions, refer to:\_ \* \_[Authenticate to Google Cloud APIs from GKE workloads](https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity) in the GKE documentation.\_ \* \_[Access control with IAM](https://cloud.google.com/secret-manager/docs/access-control) in the Secret Manager documentation.\_ Next, create a `SecretStore` that references the `demo-secrets-sa` Kubernetes service account: ```yaml {% include 'gcpsm-wif-iam-secret-store.yaml' %} ``` In the case of a `ClusterSecretStore`, you additionally have to define the service account's `namespace` under `auth.workloadIdentity.serviceAccountRef`. Finally, you can create an `ExternalSecret` for the `demo-secret` that references this `SecretStore`: ```yaml {% include 'gcpsm-wif-externalsecret.yaml' %} ``` \_Note the above secretStore example uses GCP native Workload Identity. The implementation for WorkloadIdentityFederation is defined in the [WorkloadIdentityFederation API spec](https://external-secrets.io/latest/api/spec/#external-secrets.io/v1.GCPWorkloadIdentityFederation). SecretStore example for a bare metal (on-premise) cluster:\_ ```yaml {% include 'gcpsm-wif-non-native-iam-secret-store.yaml' %} ``` #### Linking | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/google-secrets-manager.md | main | external-secrets | [
-0.09301887452602386,
-0.03972078487277031,
0.039403077214956284,
-0.026899415999650955,
-0.02102467603981495,
-0.0018435263773426414,
0.058501917868852615,
-0.0050478302873671055,
0.04591688513755798,
0.0532807782292366,
-0.018175706267356873,
-0.05336311087012291,
0.009181443601846695,
-... | 0.115465 |
for the `demo-secret` that references this `SecretStore`: ```yaml {% include 'gcpsm-wif-externalsecret.yaml' %} ``` \_Note the above secretStore example uses GCP native Workload Identity. The implementation for WorkloadIdentityFederation is defined in the [WorkloadIdentityFederation API spec](https://external-secrets.io/latest/api/spec/#external-secrets.io/v1.GCPWorkloadIdentityFederation). SecretStore example for a bare metal (on-premise) cluster:\_ ```yaml {% include 'gcpsm-wif-non-native-iam-secret-store.yaml' %} ``` #### Linking a Kubernetes service account to a GCP service account The `SecretStore` (or `ClusterSecretStore`) references a Kubernetes service account, which is linked to a GCP service account that is authorized to access Secret Manager secrets. To demonstrate this approach, we'll create a `SecretStore` in the `demo` namespace. To set up the Kubernetes service account, you need to know or choose the following values: \* `PROJECT\_ID`: Your GCP project ID, which you can find under "Project Info" on your console dashboard. Note that this might be different from your project's \_name\_. \* `GCP\_SA`: The name of the GCP service account you are going to create and use (e.g., `external-secrets`). First, create the Kubernetes service account with an annotation that references the GCP service account: ```yaml apiVersion: v1 kind: ServiceAccount metadata: name: demo-secrets-sa namespace: demo annotations: iam.gke.io/gcp-service-account: [GCP\_SA]@[PROJECT\_ID].iam.gserviceaccount.com ``` Next, create the GCP service account: ```shell gcloud iam service-accounts create $GCP\_SA \ --project=$PROJECT\_ID ``` To finalize the link between the GCP service account and the Kubernetes service account, you need two additional values: \* `K8S\_SA`: The name of the Kubernetes service account you created. (In our example, `demo-secrets-sa`.) \* `K8S\_NAMESPACE`: The namespace where you created the Kubernetes service account (In our example, `demo`.) Grant the Kubernetes service account the `iam.workloadIdentityUser` role on the GCP service account: ```shell gcloud iam service-accounts add-iam-policy-binding \ ${GCP\_SA}@${PROJECT\_ID}.iam.gserviceaccount.com \ --role="roles/iam.workloadIdentityUser" \ --member "serviceAccount:${PROJECT\_ID}.svc.id.goog[${K8S\_NAMESPACE}/${K8S\_SA}]" ``` Next, grant the GCP service account access to a secret in the Secret Manager. For example, the following CLI call grants it access to a secret `demo-secret`: ```shell gcloud secrets add-iam-policy-binding demo-secret \ --project=$PROJECT\_ID \ --role="roles/secretmanager.secretAccessor" --member "serviceAccount:${GCP\_SA}@${PROJECT\_ID}.iam.gserviceaccount.com" ``` You can also grant the GCP service account access to \_all\_ secrets in a GCP project: ```shell gcloud project add-iam-policy-binding $PROJECT\_ID \ --role="roles/secretmanager.secretAccessor" --member "serviceAccount:${GCP\_SA}@${PROJECT\_ID}.iam.gserviceaccount.com" ``` Note that this allows anyone who can create `ExternalSecret` resources referencing a `SecretStore` instance using this service account access to all secrets in the project. \_For more information about WIF and Secret Manager permissions, refer to:\_ \* \_[Authenticate to Google Cloud APIs from GKE workloads](https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity) in the GKE documentation.\_ \* \_[Access control with IAM](https://cloud.google.com/secret-manager/docs/access-control) in the Secret Manager documentation.\_ Next, create a `SecretStore` that references the `demo-secrets-sa` Kubernetes service account: ```yaml {% include 'gcpsm-wif-sa-secret-store.yaml' %} ``` In the case of a `ClusterSecretStore`, you additionally have to define the service account's `namespace` under `auth.workloadIdentity.serviceAccountRef`. Finally, you can create an `ExternalSecret` for the `demo-secret` that references this `SecretStore`: ```yaml {% include 'gcpsm-wif-externalsecret.yaml' %} ``` #### Authorizing the Core Controller Pod Instead of managing authentication at the `SecretStore` and `ClusterSecretStore` level, you can give the [Core Controller](../api/components.md) Pod's service account access to Secret Manager secrets using one of the two WIF approaches described in the previous sections. To demonstrate this approach, we'll assume you installed ESO using Helm into the `external-secrets` namespace, with `external-secrets` as the release name: ```shell helm repo add external-secrets https://charts.external-secrets.io helm install external-secrets external-secrets/external-secrets \ --namespace external-secrets --create-namespace ``` This creates a Kubernetes service account `external-secrets` in the `external-secrets` namespace, which is used by the Core Controller Pod. To verify this (or to determine the service account's name in a different setup), you can run: ```shell kubectl get pods --namespace external-secrets \ --selector app.kubernetes.io/name=external-secrets \ --output jsonpath='{.items[0].spec.serviceAccountName}' ``` Use WIF to grant this Kubernetes service account access to the Secret Manager secrets. You can use either of the | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/google-secrets-manager.md | main | external-secrets | [
-0.10876372456550598,
-0.01976299285888672,
0.02488240972161293,
0.020549587905406952,
-0.015287394635379314,
-0.0009620905620977283,
0.04678301140666008,
0.01342186238616705,
0.04040513560175896,
0.0409119687974453,
0.0361848920583725,
-0.04701049625873566,
0.019881054759025574,
0.0038968... | 0.126609 |
To verify this (or to determine the service account's name in a different setup), you can run: ```shell kubectl get pods --namespace external-secrets \ --selector app.kubernetes.io/name=external-secrets \ --output jsonpath='{.items[0].spec.serviceAccountName}' ``` Use WIF to grant this Kubernetes service account access to the Secret Manager secrets. You can use either of the approaches described in the previous two sections. \_For details and further information on WIF and Secret Manager permissions, refer to:\_ \* \_[Authenticate to Google Cloud APIs from GKE workloads](https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity) in the GKE documentation.\_ \* \_[Access control with IAM](https://cloud.google.com/secret-manager/docs/access-control) in the Secret Manager documentation.\_ Once the Core Controller Pod can access the Secret Manager secret(s) through WIF via its Kubernetes service account, you can create `SecretStore` or `ClusterSecretStore` instances that only specify the GCP project ID, omitting the `auth` section entirely: ```yaml {% include 'gcpsm-wif-core-controller-secret-store.yaml' %} ``` #### Explicitly specifying the GKE cluster's name and location When creating a `SecretStore` or `ClusterSecretStore` that uses WIF, the GKE cluster's project ID, name, and location are automatically determined through the [GCP metadata server](https://cloud.google.com/compute/docs/metadata/overview). Alternatively, you can explicitly specify some or all of these values. For a fully specified configuration, you'll need to know the following three values: \* `CLUSTER\_PROJECT\_ID`: The ID of GCP project that contains the GKE cluster. \* `CLUSTER\_NAME`: The name of the GKE cluster. \* `CLUSTER\_LOCATION`: The location of the GKE cluster. For a regional cluster, this is the region. For a zonal cluster, this is the zone. You can optionally verify these values through the CLI: ```shell gcloud container clusters describe $CLUSTER\_NAME \ --project=$CLUSTER\_PROJECT\_ID --location=$CLUSTER\_LOCATION ``` If the three values are correct, this returns information about your GKE cluster. Then, you can create a `SecretStore` or `ClusterSecretStore` that explicitly specifies the cluster's project ID, name, and location: ```yaml {% include 'gcpsm-wif-sa-secret-store-with-explicit-name-and-location.yaml' %} ``` ### Authenticating with a GCP service account The `SecretStore` (or `ClusterSecretStore`) uses a long-lived, static [GCP service account key](https://cloud.google.com/iam/docs/service-account-creds#key-types) to authenticate with GCP. This approach can be used on any Kubernetes cluster. To demonstrate this approach, we'll create a `SecretStore` in the `demo` namespace. First, create a GCP service account and grant it the `secretmanager.secretAccessor` role on the Secret Manager secret(s) you want to access. \_For details and further information on managing service account permissions and Secret Manager roles, refer to:\_ \* \_[Attach service accounts to resources](https://cloud.google.com/iam/docs/attach-service-accounts) in the IAM documentation.\_ \* \_[Access control with IAM](https://cloud.google.com/secret-manager/docs/access-control) in the Secret Manager documentation.\_ Then, create a service account key pair using one of the methods described on the page [Create and delete service account keys](https://cloud.google.com/iam/docs/keys-create-delete) in the Google Cloud IAM documentation and store the JSON file with the private key in a Kubernetes `Secret`: ```yaml {% include 'gcpsm-sa-credentials-secret.yaml' %} ``` Finally, reference this secret in the `SecretStore` manifest: ```yaml {% include 'gcpsm-sa-secret-store.yaml' %} ``` In the case of a `ClusterSecretStore`, you additionally have to specify the service account's `namespace` under `auth.secretRef.secretAccessKeySecretRef`. ## Using PushSecret with an existing Google Secret Manager secret There are some use cases where you want to use PushSecret for an existing Google Secret Manager Secret that already has labels defined. For example when the creation of the secret is managed by another controller like Kubernetes Config Connector (KCC) and the updating of the secret is managed by ESO. To allow ESO to take ownership of the existing Google Secret Manager Secret, you need to add the label `"managed-by": "external-secrets"`. By default, the PushSecret spec will replace any existing labels on the existing GCP Secret Manager Secret. To prevent this, a new field was added to the `spec.data.metadata` object called `mergePolicy` which defaults to `Replace` to ensure that there are no breaking changes and is | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/google-secrets-manager.md | main | external-secrets | [
-0.07297834008932114,
-0.013880869373679161,
0.031781766563653946,
-0.026555189862847328,
-0.02318844385445118,
-0.012958737090229988,
0.0719248428940773,
-0.031281907111406326,
0.0568583607673645,
0.06735798716545105,
0.009037111885845661,
-0.11455003172159195,
0.02580307237803936,
-0.017... | 0.083075 |
add the label `"managed-by": "external-secrets"`. By default, the PushSecret spec will replace any existing labels on the existing GCP Secret Manager Secret. To prevent this, a new field was added to the `spec.data.metadata` object called `mergePolicy` which defaults to `Replace` to ensure that there are no breaking changes and is backward compatible. The other option for this field is `Merge` which will merge the existing labels on the Google Secret Manager Secret with the labels defined in the PushSecret spec. This ensures that the existing labels defined on the Google Secret Manager Secret are retained. Example of using the `mergePolicy` field: ```yaml {% raw %} apiVersion: external-secrets.io/v1alpha1 kind: PushSecret metadata: name: pushsecret-example namespace: default spec: updatePolicy: Replace deletionPolicy: None refreshInterval: 1h0m0s secretStoreRefs: - name: gcp-secretstore kind: SecretStore selector: secret: name: bestpokemon template: data: bestpokemon: "{{ .bestpokemon }}" data: - conversionStrategy: None metadata: mergePolicy: Merge labels: anotherLabel: anotherValue match: secretKey: bestpokemon remoteRef: remoteKey: best-pokemon {% endraw %} ``` ## Secret Replication and Encryption Configuration ### Location and Replication By default, secrets are automatically replicated across multiple regions. You can specify a single location for your secrets by setting the `replicationLocation` field: ```yaml apiVersion: external-secrets.io/v1alpha1 kind: PushSecret metadata: name: pushsecret-example spec: # ... other fields ... data: - match: secretKey: mykey remoteRef: remoteKey: my-secret metadata: apiVersion: kubernetes.external-secrets.io/v1alpha1 kind: PushSecretMetadata spec: replicationLocation: "us-east1" ``` ### Customer-Managed Encryption Keys (CMEK) You can use your own encryption keys to encrypt secrets at rest. To use Customer-Managed Encryption Keys (CMEK), you need to: 1. Create a Cloud KMS key 2. Grant the service account the `roles/cloudkms.cryptoKeyEncrypterDecrypter` role on the key 3. Specify the key in the PushSecret metadata ```yaml apiVersion: external-secrets.io/v1alpha1 kind: PushSecret metadata: name: pushsecret-example spec: # ... other fields ... data: - match: secretKey: mykey remoteRef: remoteKey: my-secret metadata: apiVersion: kubernetes.external-secrets.io/v1alpha1 kind: PushSecretMetadata spec: cmekKeyName: "projects/my-project/locations/us-east1/keyRings/my-keyring/cryptoKeys/my-key" ``` Note: When using CMEK, you must specify a location in the SecretStore as customer-managed encryption keys are region-specific. ```yaml apiVersion: external-secrets.io/v1 kind: SecretStore metadata: name: gcp-secret-store spec: provider: gcpsm: projectID: my-project location: us-east1 # Required when using CMEK ``` ## Regional Secrets GCP Secret Manager Regional Secrets are available to be used with both ExternalSecrets and PushSecrets. In order to achieve so, add a `location` to your SecretStore definition: ```yaml apiVersion: external-secrets.io/v1beta1 kind: SecretStore metadata: name: gcp-secret-store spec: provider: gcpsm: projectID: my-project location: us-east1 # uses regional secrets on us-east1 ``` ## Secret Version Management ### Secret Version Selection Policy The Google Secret Manager provider includes a `secretVersionSelectionPolicy` field that controls how the provider handles secret version selection when the default "latest" version is unavailable. By default, when you request a secret without specifying a version, the provider attempts to fetch the "latest" version. The `secretVersionSelectionPolicy` determines what happens if that version is in a DESTROYED or DISABLED state. #### Available Policies - \*\*`LatestOrFail`\*\* (default): The provider always uses "latest", or fails if that version is disabled/destroyed. - \*\*`LatestOrFetch`\*\*: The provider falls back to fetching the latest enabled version if the "latest" version is DESTROYED or DISABLED. #### Configuration Example ```yaml apiVersion: external-secrets.io/v1beta1 kind: SecretStore metadata: name: gcp-secret-store spec: provider: gcpsm: projectID: my-project location: us-east1 secretVersionSelectionPolicy: LatestOrFetch # or LatestOrFail (default) ``` \*\*Note\*\*: When using `secretVersionSelectionPolicy: LatestOrFetch`, the service account requires additional permissions to list secret versions. You'll need to grant the `roles/secretmanager.viewer` role (which includes `secretmanager.versions.list`) or the specific `secretmanager.versions.list` permission in addition to the standard `secretmanager.secretAccessor` role. ``` | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/google-secrets-manager.md | main | external-secrets | [
-0.09350186586380005,
-0.06376907974481583,
0.0071620037779212,
0.02028101682662964,
-0.03461147099733353,
0.028493717312812805,
0.031960636377334595,
0.0011368653504177928,
-0.0019907793030142784,
0.0075239273719489574,
0.0719418078660965,
-0.040352948009967804,
0.003670112229883671,
-0.0... | -0.004767 |
or the specific `secretmanager.versions.list` permission in addition to the standard `secretmanager.secretAccessor` role. ``` | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/google-secrets-manager.md | main | external-secrets | [
-0.03463947772979736,
-0.008543566800653934,
-0.05339377000927925,
-0.0033926137257367373,
0.06944441050291061,
-0.028677726164460182,
-0.026958921924233437,
-0.04114098101854324,
-0.08240120112895966,
0.0013644715072587132,
0.08274531364440918,
0.01960197649896145,
-0.022574884817004204,
... | 0.015226 |
 ## Hashicorp Vault External Secrets Operator integrates with [HashiCorp Vault](https://www.vaultproject.io/) for secret management. The [KV Secrets Engine](https://www.vaultproject.io/docs/secrets/kv) is the only one supported by this provider. For other secrets engines, please refer to the [Vault Generator](../api/generator/vault.md). ### Example First, create a SecretStore with a vault backend. For the sake of simplicity we'll use a static token `root`: ```yaml apiVersion: external-secrets.io/v1 kind: SecretStore metadata: name: vault-backend spec: provider: vault: server: "http://my.vault.server:8200" path: "secret" # Version is the Vault KV secret engine version. # This can be either "v1" or "v2", defaults to "v2" version: "v2" auth: # points to a secret that contains a vault token # https://www.vaultproject.io/docs/auth/token tokenSecretRef: name: "vault-token" key: "token" --- apiVersion: v1 kind: Secret metadata: name: vault-token data: token: cm9vdA== # "root" ``` \*\*NOTE:\*\* In case of a `ClusterSecretStore`, Be sure to provide `namespace` for `tokenSecretRef` with the namespace of the secret that we just created. Then create a simple k/v pair at path `secret/foo`: ``` vault kv put secret/foo my-value=s3cr3t ``` Can check kv version using following and check for `Options` column, it should indicate [version:2]: ``` vault secrets list -detailed ``` If you are using version: 1, just remember to update your SecretStore manifest appropriately Now create a ExternalSecret that uses the above SecretStore: ```yaml apiVersion: external-secrets.io/v1 kind: ExternalSecret metadata: name: vault-example spec: refreshInterval: "15s" secretStoreRef: name: vault-backend kind: SecretStore target: name: example-sync data: - secretKey: foobar remoteRef: key: foo property: my-value # metadataPolicy to fetch all the labels in JSON format - secretKey: tags remoteRef: metadataPolicy: Fetch key: foo # metadataPolicy to fetch a specific label (dev) from the source secret - secretKey: developer remoteRef: metadataPolicy: Fetch key: foo property: dev --- # That will automatically create a Kubernetes Secret with: # apiVersion: v1 # kind: Secret # metadata: # name: example-sync # data: # foobar: czNjcjN0 ``` Keep in mind that fetching the labels with `metadataPolicy: Fetch` only works with KV sercrets engine version v2. #### Fetching Raw Values You can fetch all key/value pairs for a given path If you leave the `remoteRef.property` empty. This returns the json-encoded secret value for that path. ```yaml apiVersion: external-secrets.io/v1 kind: ExternalSecret metadata: name: vault-example spec: # ... data: - secretKey: foobar remoteRef: key: /dev/package.json ``` #### Nested Values Vault supports nested key/value pairs. You can specify a [gjson](https://github.com/tidwall/gjson) expression at `remoteRef.property` to get a nested value. Given the following secret - assume its path is `/dev/config`: ```json { "foo": { "nested": { "bar": "mysecret" } } } ``` You can set the `remoteRef.property` to point to the nested key using a [gjson](https://github.com/tidwall/gjson) expression. ```yaml apiVersion: external-secrets.io/v1 kind: ExternalSecret metadata: name: vault-example spec: # ... data: - secretKey: foobar remoteRef: key: /dev/config property: foo.nested.bar --- # creates a secret with: # foobar=mysecret ``` If you would set the `remoteRef.property` to just `foo` then you would get the json-encoded value of that property: `{"nested":{"bar":"mysecret"}}`. #### Multiple nested Values You can extract multiple keys from a nested secret using `dataFrom`. Given the following secret - assume its path is `/dev/config`: ```json { "foo": { "nested": { "bar": "mysecret", "baz": "bang" } } } ``` You can set the `remoteRef.property` to point to the nested key using a [gjson](https://github.com/tidwall/gjson) expression. ```yaml apiVersion: external-secrets.io/v1 kind: ExternalSecret metadata: name: vault-example spec: # ... dataFrom: - extract: key: /dev/config property: foo.nested ``` That results in a secret with these values: ``` bar=mysecret baz=bang ``` #### Getting multiple secrets You can extract multiple secrets from Hashicorp vault by using `dataFrom.Find` Currently, `dataFrom.Find` allows users to fetch secret names that match a given regexp pattern, or fetch secrets whose `custom\_metadata` tags match a | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/hashicorp-vault.md | main | external-secrets | [
-0.023246437311172485,
0.03989475592970848,
-0.06250884383916855,
-0.03164185583591461,
-0.027989989146590233,
-0.019236845895648003,
-0.10234123468399048,
0.04546911641955376,
0.00684089632704854,
-0.08694328367710114,
0.045122601091861725,
-0.03800669685006142,
0.07336878031492233,
0.001... | 0.028603 |
``` That results in a secret with these values: ``` bar=mysecret baz=bang ``` #### Getting multiple secrets You can extract multiple secrets from Hashicorp vault by using `dataFrom.Find` Currently, `dataFrom.Find` allows users to fetch secret names that match a given regexp pattern, or fetch secrets whose `custom\_metadata` tags match a predefined set. !!! warning The way hashicorp Vault currently allows LIST operations is through the existence of a secret metadata. If you delete the secret, you will also need to delete the secret's metadata or this will currently make Find operations fail. Given the following secret - assume its path is `/dev/config`: ```json { "foo": { "nested": { "bar": "mysecret", "baz": "bang" } } } ``` Also consider the following secret has the following `custom\_metadata`: ```json { "environment": "dev", "component": "app-1" } ``` It is possible to find this secret by all the following possibilities: ```yaml apiVersion: external-secrets.io/v1 kind: ExternalSecret metadata: name: vault-example spec: # ... dataFrom: - find: #will return every secret with 'dev' in it (including paths) name: regexp: dev - find: #will return every secret matching environment:dev tags from dev/ folder and beyond tags: environment: dev ``` will generate a secret with: ```json { "dev\_config":"{\"foo\":{\"nested\":{\"bar\":\"mysecret\",\"baz\":\"bang\"}}}" } ``` Currently, `Find` operations are recursive throughout a given vault folder, starting on `provider.Path` definition. It is recommended to narrow down the scope of search by setting a `find.path` variable. This is also useful to automatically reduce the resulting secret key names: ```yaml apiVersion: external-secrets.io/v1 kind: ExternalSecret metadata: name: vault-example spec: # ... dataFrom: - find: #will return every secret from dev/ folder path: dev name: regexp: ".\*" - find: #will return every secret matching environment:dev tags from dev/ folder path: dev tags: environment: dev ``` Will generate a secret with: ```json { "config":"{\"foo\": {\"nested\": {\"bar\": \"mysecret\",\"baz\": \"bang\"}}}" } ``` ### Authentication We support five different modes for authentication: [token-based](https://www.vaultproject.io/docs/auth/token), [appRole](https://www.vaultproject.io/docs/auth/approle), [kubernetes-native](https://www.vaultproject.io/docs/auth/kubernetes), [ldap](https://www.vaultproject.io/docs/auth/ldap), [userPass](https://www.vaultproject.io/docs/auth/userpass), [jwt/oidc](https://www.vaultproject.io/docs/auth/jwt), [awsAuth](https://developer.hashicorp.com/vault/docs/auth/aws) and [tlsCert](https://developer.hashicorp.com/vault/docs/auth/cert), each one comes with it's own trade-offs. Depending on the authentication method you need to adapt your environment. If you're using Vault namespaces, you can authenticate into one namespace and use the vault token against a different namespace, if desired. #### Token-based authentication A static token is stored in a `Kind=Secret` and is used to authenticate with vault. ```yaml {% include 'vault-token-store.yaml' %} ``` \*\*NOTE:\*\* In case of a `ClusterSecretStore`, Be sure to provide `namespace` in `tokenSecretRef` with the namespace where the secret resides. #### AppRole authentication example [AppRole authentication](https://www.vaultproject.io/docs/auth/approle) reads the secret id from a `Kind=Secret` and uses the specified `roleId` to acquire a temporary token to fetch secrets. ```yaml {% include 'vault-approle-store.yaml' %} ``` \*\*NOTE:\*\* In case of a `ClusterSecretStore`, Be sure to provide `namespace` in `secretRef` with the namespace where the secret resides. #### Kubernetes authentication [Kubernetes-native authentication](https://www.vaultproject.io/docs/auth/kubernetes) has three options of obtaining credentials for vault: 1. by using a service account jwt referenced in `serviceAccountRef` 2. by using the jwt from a `Kind=Secret` referenced by the `secretRef` 3. by using transient credentials from the mounted service account token within the external-secrets operator Vault validates the service account token by using the TokenReview API. ⚠️ You have to bind the `system:auth-delegator` ClusterRole to the service account that is used for authentication. Please follow the [Vault documentation](https://developer.hashicorp.com/vault/docs/auth/kubernetes#configuring-kubernetes). ```yaml {% include 'vault-kubernetes-store.yaml' %} ``` \*\*NOTE:\*\* In case of a `ClusterSecretStore`, Be sure to provide `namespace` in `serviceAccountRef` or in `secretRef`, if used. \*\*NOTE:\*\* Starting with Vault 1.20, roles without an audience will trigger warnings during authentication. In Vault 1.21 and later, roles must include an audience or authentication will fail. Update your role definitions to include an audience, for example: ```yaml auth: | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/hashicorp-vault.md | main | external-secrets | [
-0.053414151072502136,
0.08658817410469055,
-0.024454448372125626,
0.021352756768465042,
0.005078715272247791,
-0.050533898174762726,
-0.021719591692090034,
0.004459581803530455,
0.05762151628732681,
-0.03379802033305168,
0.0426318496465683,
-0.036950379610061646,
0.07012946903705597,
-0.0... | -0.010646 |
to provide `namespace` in `serviceAccountRef` or in `secretRef`, if used. \*\*NOTE:\*\* Starting with Vault 1.20, roles without an audience will trigger warnings during authentication. In Vault 1.21 and later, roles must include an audience or authentication will fail. Update your role definitions to include an audience, for example: ```yaml auth: kubernetes: mountPath: kubernetes/my-cluster role: my-role serviceAccountRef: name: my-service-account audiences: - vault # Required for Vault 1.21+ ``` #### LDAP authentication [LDAP authentication](https://www.vaultproject.io/docs/auth/ldap) uses username/password pair to get an access token. Username is stored directly in a `Kind=SecretStore` or `Kind=ClusterSecretStore` resource, password is stored in a `Kind=Secret` referenced by the `secretRef`. ```yaml {% include 'vault-ldap-store.yaml' %} ``` \*\*NOTE:\*\* In case of a `ClusterSecretStore`, Be sure to provide `namespace` in `secretRef` with the namespace where the secret resides. #### UserPass authentication [UserPass authentication](https://www.vaultproject.io/docs/auth/userpass) uses username/password pair to get an access token. Username is stored directly in a `Kind=SecretStore` or `Kind=ClusterSecretStore` resource, password is stored in a `Kind=Secret` referenced by the `secretRef`. ```yaml {% include 'vault-userpass-store.yaml' %} ``` \*\*NOTE:\*\* In case of a `ClusterSecretStore`, Be sure to provide `namespace` in `secretRef` with the namespace where the secret resides. #### JWT/OIDC authentication [JWT/OIDC](https://www.vaultproject.io/docs/auth/jwt) uses either a [JWT](https://jwt.io/) token stored in a `Kind=Secret` and referenced by the `secretRef` or a temporary Kubernetes service account token retrieved via the `TokenRequest` API. Optionally a `role` field can be defined in a `Kind=SecretStore` or `Kind=ClusterSecretStore` resource. ```yaml {% include 'vault-jwt-store.yaml' %} ``` \*\*NOTE:\*\* In case of a `ClusterSecretStore`, Be sure to provide `namespace` in `secretRef` with the namespace where the secret resides. #### AWS IAM authentication [AWS IAM](https://developer.hashicorp.com/vault/docs/auth/aws) uses either a set of AWS Programmatic access credentials stored in a `Kind=Secret` and referenced by the `secretRef` or by getting the authentication token from an [IRSA](https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html) enabled service account #### TLS certificates authentication [TLS certificates auth method](https://developer.hashicorp.com/vault/docs/auth/cert) allows authentication using SSL/TLS client certificates which are either signed by a CA or self-signed. SSL/TLS client certificates are defined as having an ExtKeyUsage extension with the usage set to either ClientAuth or Any. ### Mutual authentication (mTLS) Under specific compliance requirements, the Vault server can be set up to enforce mutual authentication from clients across all APIs by configuring the server with `tls\_require\_and\_verify\_client\_cert = true`. This configuration differs fundamentally from the [TLS certificates auth method](#tls-certificates-authentication). While the TLS certificates auth method allows the issuance of a Vault token through the `/v1/auth/cert/login` API, the mTLS configuration solely focuses on TLS transport layer authentication and lacks any authorization-related capabilities. It's important to note that the Vault token must still be included in the request, following any of the supported authentication methods mentioned earlier. ```yaml {% include 'vault-mtls-store.yaml' %} ``` ### Access Key ID & Secret Access Key You can store Access Key ID & Secret Access Key in a `Kind=Secret` and reference it from a SecretStore. ```yaml {% include 'vault-iam-store-static-creds.yaml' %} ``` \*\*NOTE:\*\* In case of a `ClusterSecretStore`, Be sure to provide `namespace` in `accessKeyIDSecretRef`, `secretAccessKeySecretRef` with the namespaces where the secrets reside. ### EKS Service Account credentials This feature lets you use short-lived service account tokens to authenticate with AWS. You must have [Service Account Volume Projection](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#service-account-token-volume-projection) enabled - it is by default on EKS. See [EKS guide](https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts-technical-overview.html) on how to set up IAM roles for service accounts. The big advantage of this approach is that ESO runs without any credentials. ```yaml {% include 'vault-iam-store-sa.yaml' %} ``` Reference the service account from above in the Secret Store: ```yaml {% include 'vault-iam-store.yaml' %} ``` ### Controller's Pod Identity This is basically a zero-configuration authentication approach that inherits the credentials from the controller's pod identity. This approach supports both [IRSA (IAM Roles for Service | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/hashicorp-vault.md | main | external-secrets | [
0.011501826345920563,
-0.05341041088104248,
-0.028378695249557495,
0.0006706384010612965,
-0.04639419913291931,
-0.014423688873648643,
0.05383619666099548,
-0.04230264946818352,
0.06559620052576065,
-0.02649758569896221,
0.0002755938039626926,
-0.09291972219944,
0.10202416032552719,
0.0208... | 0.022221 |
{% include 'vault-iam-store-sa.yaml' %} ``` Reference the service account from above in the Secret Store: ```yaml {% include 'vault-iam-store.yaml' %} ``` ### Controller's Pod Identity This is basically a zero-configuration authentication approach that inherits the credentials from the controller's pod identity. This approach supports both [IRSA (IAM Roles for Service Accounts)](https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html) and [AWS Pod Identity](https://docs.aws.amazon.com/eks/latest/userguide/pod-identities.html): - \*\*IRSA\*\*: Requires appropriate IRSA setup on the controller's pod (i.e. IRSA enabled IAM role is created and controller's service account is annotated with "eks.amazonaws.com/role-arn") - \*\*Pod Identity\*\*: Requires [EKS Pod Identity](https://docs.aws.amazon.com/eks/latest/userguide/pod-identities.html) setup with the controller's service account associated with an IAM role The provider automatically detects which authentication method is available and uses the appropriate one. ```yaml {% include 'vault-iam-store-controller-pod-identity.yaml' %} ``` \*\*NOTE:\*\* In case of a `ClusterSecretStore`, Be sure to provide `namespace` for `serviceAccountRef` with the namespace where the service account resides. ```yaml {% include 'vault-jwt-store.yaml' %} ``` \*\*NOTE:\*\* In case of a `ClusterSecretStore`, Be sure to provide `namespace` in `secretRef` with the namespace where the secret resides. ### PushSecret Vault supports PushSecret features which allow you to sync a given Kubernetes secret key into a Hashicorp vault secret. To do so, it is expected that the secret key is a valid JSON object or that the `property` attribute has been specified under the `remoteRef`. To use PushSecret, you need to give `create`, `read` and `update` permissions to the path where you want to push secrets for both `data` and `metadata` of the secret. Use it with care! !!! note Since Vault KV v1 API is not supported with storing secrets metadata, PushSecret will add a `custom\_metadata` map to each secret in Vault that he will manage. It means pushing secret keys named `custom\_metadata` is not supported with Vault KV v1. Here is an example of how to set up `PushSecret`: ```yaml {% include 'vault-pushsecret.yaml' %} ``` Note that in this example, we are generating two secrets in the target vault with the same structure but using different input formats. #### Check-And-Set (CAS) for PushSecret Vault KV v2 supports Check-And-Set operations to prevent unintentional overwrites when multiple clients modify the same secret. When CAS is enabled in your Vault configuration, External Secrets Operator can be configured to include the required version parameter in write operations. To enable CAS support, add the `checkAndSet` configuration to your Vault provider: ```yaml apiVersion: external-secrets.io/v1 kind: SecretStore metadata: name: vault-backend spec: provider: vault: server: "http://my.vault.server:8200" path: "secret" version: "v2" # CAS only works with KV v2 checkAndSet: required: true # Enable CAS for all write operations auth: # ... authentication config ``` !!! note "CAS Requirements" - CAS is only supported with Vault KV v2 stores - When `checkAndSet.required` is true, all PushSecret operations will include version information - For new secrets, External Secrets Operator uses CAS version 0 - For existing secrets, it automatically retrieves the current version before updating - CAS helps prevent conflicts when multiple External Secrets instances manage the same secrets ### Vault Enterprise #### Eventual Consistency and Performance Standby Nodes When using Vault Enterprise with [performance standby nodes](https://www.vaultproject.io/docs/enterprise/consistency#performance-standby-nodes), any follower can handle read requests immediately after the provider has authenticated. Since Vault becomes eventually consistent in this mode, these requests can fail if the login has not yet propagated to each server's local state. Below are two different solutions to this scenario. You'll need to review them and pick the best fit for your environment and Vault configuration. #### Vault Namespaces [Vault namespaces](https://www.vaultproject.io/docs/enterprise/namespaces) are an enterprise feature that support multi-tenancy. You can specify a vault namespace using the `namespace` property when you define a SecretStore: ```yaml apiVersion: external-secrets.io/v1 kind: SecretStore metadata: name: vault-backend | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/hashicorp-vault.md | main | external-secrets | [
-0.06385571509599686,
0.04305260255932808,
-0.05119612067937851,
-0.014236505143344402,
0.02034110203385353,
0.007544263266026974,
0.08323191106319427,
-0.02051582559943199,
0.09696315973997116,
0.05540226027369499,
0.07747992128133774,
-0.030521491542458534,
0.07770787179470062,
-0.027581... | 0.10238 |
need to review them and pick the best fit for your environment and Vault configuration. #### Vault Namespaces [Vault namespaces](https://www.vaultproject.io/docs/enterprise/namespaces) are an enterprise feature that support multi-tenancy. You can specify a vault namespace using the `namespace` property when you define a SecretStore: ```yaml apiVersion: external-secrets.io/v1 kind: SecretStore metadata: name: vault-backend spec: provider: vault: server: "http://my.vault.server:8200" # See https://www.vaultproject.io/docs/enterprise/namespaces namespace: "ns1" path: "secret" version: "v2" auth: # ... ``` ##### Authenticating into a different namespace In some situations your authentication backend may be in one namespace, and your secrets in another. You can authenticate into one namespace, and use that token against another, by setting `provider.vault.namespace` and `provider.vault.auth.namespace` to different values. If `provider.vault.auth.namespace` is unset but `provider.vault.namespace` is, it will default to the `provider.vault.namespace` value. ```yaml apiVersion: external-secrets.io/v1 kind: SecretStore metadata: name: vault-backend spec: provider: vault: server: "http://my.vault.server:8200" # See https://www.vaultproject.io/docs/enterprise/namespaces namespace: "app-team" path: "secret" version: "v2" auth: namespace: "kubernetes-team" # ... ``` #### Read Your Writes Vault 1.10.0 and later encodes information in the token to detect the case when a server is behind. If a Vault server does not have information about the provided token, [Vault returns a 412 error](https://www.vaultproject.io/docs/faq/ssct#q-is-there-anything-else-i-need-to-consider-to-achieve-consistency-besides-upgrading-to-vault-1-10) so clients know to retry. A method supported in versions Vault 1.7 and later is to utilize the `X-Vault-Index` header returned on all write requests (including logins). Passing this header back on subsequent requests instructs the Vault client to retry the request until the server has an index greater than or equal to that returned with the last write. Obviously though, this has a performance hit because the read is blocked until the follower's local state has caught up. #### Forward Inconsistent Vault also supports proxying inconsistent requests to the current cluster leader for immediate read-after-write consistency. Vault 1.10.0 and later [support a replication configuration](https://www.vaultproject.io/docs/faq/ssct#q-is-there-a-new-configuration-that-this-feature-introduces) that detects when forwarding should occur and does it transparently to the client. In Vault 1.7 forwarding can be achieved by setting the `X-Vault-Inconsistent` header to `forward-active-node`. By default, this behavior is disabled and must be explicitly enabled in the server's [replication configuration](https://www.vaultproject.io/docs/configuration/replication#allow\_forwarding\_via\_header). | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/hashicorp-vault.md | main | external-secrets | [
-0.004629550501704216,
-0.03693104535341263,
-0.07179690152406693,
-0.03044935315847397,
-0.03866133466362953,
-0.0848216637969017,
-0.06460315734148026,
0.008431206457316875,
0.042362697422504425,
-0.02005649358034134,
0.024921651929616928,
-0.030164644122123718,
0.06134829670190811,
0.04... | -0.074158 |
## Oracle Vault External Secrets Operator integrates with the [Oracle Cloud Infrastructure (OCI) REST API](https://docs.oracle.com/en-us/iaas/api/) to manage secrets in Oracle Vault. All secret operations exposed by External Secrets Operator are supported by the Oracle provider. For more information on managing OCI Vaults and OCI Vault Secrets, see the following documentation: - [Managing Vaults](https://docs.oracle.com/en-us/iaas/Content/KeyManagement/Tasks/managingvaults.htm) - [Managing Vault Secrets](https://docs.oracle.com/en-us/iaas/Content/KeyManagement/Tasks/managingsecrets.htm) ## Authentication External Secrets Operator may authenticate to OCI Vault using User Principal, [Instance Principal](https://blogs.oracle.com/developers/post/accessing-the-oracle-cloud-infrastructure-api-using-instance-principals), or [Workload Identity](https://blogs.oracle.com/cloud-infrastructure/post/oke-workload-identity-greater-control-access). To specify the authenticating principal in a secret store, set the `spec.provider.oracle.principalType` value. Note that the value of `principalType` defaults `InstancePrincipal` if not set. ```yaml {% include 'oracle-principal-type.yaml' %} ``` ### User Principal Authentication For user principal authentication, region, user OCID, tenancy OCID, private key, and fingerprint are required. The private key and fingerprint must be supplied in a Kubernetes secret, while the user OCID, tenancy OCID, and region should be set in the secret store. To get your user principal information, find url for the OCI region you are accessing.  Select tenancy in the top right to see your tenancy OCID as shown below.  Select your user in the top right to see your user OCID as shown below.  Your fingerprint will be attached to your API key, once it has been generated. Private keys can be created or uploaded on the same page as the your user OCID.  Once you click "Add API Key" you will be shown the following, where you can download the key in the necessary PEM format for API requests. Creating a private key will automatically generate a fingerprint.  Next, create a secret containing your private key and fingerprint: ```yaml {% include 'oracle-credentials-secret.yaml' %} ``` After creating the credentials secret, the secret store can be configured: ```yaml {% include 'oracle-secret-store.yaml' %} ``` \*\*NOTE:\*\* In case of a `ClusterSecretStore`, Be sure to provide `namespace` in `privatekey` and `fingerprint` with the namespaces where the secrets reside. ### Instance Principal Authentication (OCI) Instance Principal uses a pod's instance principal to authenticate to OCI Vault. Ensure your cluster instances have the appropriate policies to use [Instance Principal](https://blogs.oracle.com/developers/post/accessing-the-oracle-cloud-infrastructure-api-using-instance-principals). ```yaml {% include 'oracle-instance-principal.yaml' %} ``` ### Workload Identity Authentication (OCI/OKE) [Workload Identity](https://blogs.oracle.com/cloud-infrastructure/post/oke-workload-identity-greater-control-access) can be used to grant the External Secrets Operator pod policy driven access to OCI Vault when running on Oracle Container Engine for Kubernetes (OKE). Note that if a service account is not provided in the secret store, the Oracle provider will authenticate using the service account token of the External Secrets Operator. ```yaml {% include 'oracle-workload-identity.yaml' %} ``` ## Creating an External Secret To create a Kubernetes secret from an OCI Vault secret a `Kind=ExternalSecret` is needed. The External Secret will reference an OCI Vault instance containing secrets with either JSON or plaintext data. #### External Secret targeting JSON data ```yaml {% include 'oracle-external-secret.yaml' %} ``` #### External Secret targeting plaintext data ```yaml {% include 'oracle-external-secret-plaintext.yaml' %} ``` ### Getting the Kubernetes secret The operator will fetch the OCI Vault Secret and inject it as a `Kind=Secret`. ``` kubectl get secret oracle-secret-to-create -o jsonpath='{.data.dev-secret-test}' | base64 -d ``` ## PushSecrets and retrieving multiple secrets. When using [PushSecrets](https://external-secrets.io/latest/guides/pushsecrets/), the compartment OCID and encryption key OCID must be specified in the Oracle SecretStore. You can find your compartment and encryption key OCIDs in the OCI console. If [retrieving multiple secrets](https://external-secrets.io/latest/guides/getallsecrets/) by tag or regex, only the compartment OCID must be specified. ```yaml {% include 'oracle-secret-store-pushsecret.yaml' %} ``` | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/oracle-vault.md | main | external-secrets | [
-0.08091248571872711,
0.03045564331114292,
-0.05628644675016403,
-0.03588028997182846,
-0.033950939774513245,
-0.07309229671955109,
0.020871879532933235,
0.025722911581397057,
0.046736910939216614,
-0.011195330880582333,
0.02193441241979599,
-0.0034757170360535383,
0.03413587436079979,
0.0... | 0.066687 |
secrets](https://external-secrets.io/latest/guides/getallsecrets/) by tag or regex, only the compartment OCID must be specified. ```yaml {% include 'oracle-secret-store-pushsecret.yaml' %} ``` | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/oracle-vault.md | main | external-secrets | [
-0.08719836920499802,
0.025257309898734093,
-0.024835625663399696,
-0.006193779408931732,
0.03055294044315815,
-0.029730819165706635,
0.06828472018241882,
0.05685565620660782,
0.013216652907431126,
-0.016736118122935295,
0.08432239294052124,
-0.05868016555905342,
0.01707206666469574,
0.005... | 0.028616 |
## 1Password Secrets with SDK 1Password released [developer SDKs](https://developer.1password.com/docs/sdks/) to ease the usage of the secret provider without the need for any external devices. This provides a much better user experience for automated processes without the need of the connect server. \_Note\_: In order to use ESO with 1Password SDK, documents must have unique label names. Meaning, if there is a label that has the same title as another label we won't know which one to update and an error is thrown: `found multiple labels with the same key`. ### Store Configuration A store is per vault. This is to prevent a single ExternalSecret potentially accessing ALL vaults. A sample store configuration looks like this: ```yaml {% include '1passwordsdk-secret-store.yaml' %} ``` ### Client-Side Caching Optional client-side caching reduces 1Password API calls. Configure TTL and cache size in the store: ```yaml apiVersion: external-secrets.io/v1 kind: SecretStore metadata: name: 1password-cached spec: provider: onepasswordSDK: vault: production auth: serviceAccountSecretRef: name: op-token key: token cache: ttl: 5m # Optional, default: 5m maxSize: 100 # Optional, default: 100 ``` Caching applies to read operations (`GetSecret`, `GetSecretMap`). Write operations (`PushSecret`, `DeleteSecret`) automatically invalidate relevant cache entries. !!! warning "Experimental" This is an experimental feature and if too long of a TTL is set, secret information might be out of date. ### GetSecret Valid secret references should use the following key format: `/[section/]`. This is described here: [Secret Reference Syntax](https://developer.1password.com/docs/cli/secret-reference-syntax/). For a one-time password use the following key format: `/[section/]one-time password?attribute=otp`. ```yaml {% include '1passwordsdk-external-secret.yaml' %} ``` ### PushSecret Pushing a secret is also supported. For example a push operation with the following secret: ```yaml apiVersion: v1 kind: Secret metadata: name: source-secret stringData: source-key: "my-secret" ``` Looks like this: ```yaml {% include '1passwordsdk-push-secret.yaml' %} ``` Once all fields of a secret are deleted, the entire secret is deleted if the PushSecret object is removed and policy is set to `delete`. ### Supported Functionality Please check the documentation on 1password for [Supported Functionality](https://developer.1password.com/docs/sdks/functionality). | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/1password-sdk.md | main | external-secrets | [
-0.08490574359893799,
0.015242844820022583,
-0.06739155948162079,
-0.015063416212797165,
-0.01537329237908125,
-0.039435554295778275,
0.043679751455783844,
-0.004350487608462572,
0.06459695845842361,
-0.013331483118236065,
0.05255836248397827,
-0.025076065212488174,
0.09354478865861893,
-0... | 0.103061 |
External Secrets Operator integrates with [Device42 API](https://api.device42.com/#!/Passwords/getPassword) to sync Device42 secrets into a Kubernetes cluster. ### Authentication `username` and `password` is required to talk to the Device42 API. ```yaml apiVersion: v1 kind: Secret metadata: name: device42-credentials data: username: dGVzdA== # "test" password: dGVzdA== # "test" ``` ### Creating a SecretStore ```yaml apiVersion: external-secrets.io/v1 kind: SecretStore metadata: name: device42-secret-store spec: provider: device42: host: auth: secretRef: credentials: name: key: namespace: ``` ### Referencing Secrets Secrets can be referenced by defining the `key` containing the Id of the secret. The `password` field is return from device42 ```yaml apiVersion: external-secrets.io/v1 kind: ExternalSecret metadata: name: device42-external-secret spec: refreshInterval: 1h0m0s secretStoreRef: kind: SecretStore name: device42-secret-store target: name: data: - secretKey: remoteRef: key: ``` | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/device42.md | main | external-secrets | [
-0.034178685396909714,
-0.03003661520779133,
0.024146882817149162,
-0.026406720280647278,
-0.02791726589202881,
-0.029032131657004356,
-0.022164108231663704,
0.015051514841616154,
0.08269298076629639,
0.04888752102851868,
0.022246992215514183,
-0.032294075936079025,
0.024213502183556557,
0... | 0.073976 |
External Secrets Operator integrates with [Passbolt API](https://www.passbolt.com/) to sync Passbolt to secrets held on the Kubernetes cluster. ### Creating a Passbolt secret store Be sure the `passbolt` provider is listed in the `Kind=SecretStore` and auth and host are set. The API requires a password and private key provided in a secret. ```yaml {% include 'passbolt-secret-store.yaml' %} ``` ### Creating an external secret To sync a Passbolt secret to a Kubernetes secret, a `Kind=ExternalSecret` is needed. By default the secret contains name, username, uri, password and description. To only select a single property add the `property` key. ```yaml {% include 'passbolt-external-secret-example.yaml' %} ``` The above external secret will lead to the creation of a secret in the following form: ```yaml {% include 'passbolt-secret-example.yaml' %} ``` ### Finding a secret by name Instead of retrieving secrets by ID you can also use `dataFrom` to search for secrets by name. ```yaml {% include 'passbolt-external-secret-findbyname.yaml' %} ``` | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/passbolt.md | main | external-secrets | [
-0.060316476970911026,
-0.01775216870009899,
0.028053315356373787,
0.04651091992855072,
-0.021641220897436142,
0.0019114650785923004,
-0.0005195630947127938,
0.018203632906079292,
0.07537677884101868,
0.035195492208004,
-0.015726085752248764,
-0.07864141464233398,
0.011559274047613144,
-0.... | 0.053203 |
# Delinea Secret-Server/Platform For detailed information about configuring Kubernetes ESO with Secret Server and the Delinea Platform, see the https://docs.delinea.com/online-help/integrations/external-secrets/kubernetes-eso-secret-server.htm ### Creating a SecretStore You need a username, password and a fully qualified Secret-Server/Platform tenant URL to authenticate i.e. `https://yourTenantName.secretservercloud.com` or `https://yourtenantname.delinea.app`. Both username and password can be specified either directly in your `SecretStore` yaml config, or by referencing a kubernetes secret. Both `username` and `password` can either be specified directly via the `value` field (example below) >spec.provider.secretserver.username.value: "yourusername" spec.provider.secretserver.password.value: "yourpassword" Or you can reference a kubernetes secret (password example below). \*\*Note:\*\* Use `https://yourtenantname.secretservercloud.com` for Secret Server or `https://yourtenantname.delinea.app` for Platform. ```yaml apiVersion: external-secrets.io/v1 kind: SecretStore metadata: name: secret-server-store spec: provider: secretserver: serverURL: "https://yourtenantname.secretservercloud.com" # or "https://yourtenantname.delinea.app" for Platform username: value: "yourusername" password: secretRef: name: key: ``` ### Referencing Secrets Secrets may be referenced by: >Secret ID Secret Name Secret Path (/FolderName/SecretName) Please note if using the secret name or path, the name field must not contain spaces or control characters. If multiple secrets are found, \*`only the first found secret will be returned`\*. Please note: `Retrieving a specific version of a secret is not yet supported.` Note that because all Secret-Server/Platform secrets are JSON objects, you must specify the `remoteRef.property` in your ExternalSecret configuration. You can access nested values or arrays using [gjson syntax](https://github.com/tidwall/gjson/blob/master/SYNTAX.md). ```yaml apiVersion: external-secrets.io/v1 kind: ExternalSecret metadata: name: secret-server-external-secret spec: refreshInterval: 1h0m0s secretStoreRef: kind: SecretStore name: secret-server-store data: - secretKey: SecretServerValue # remoteRef: key: "52622" # property: "array.0.value" # \* an empty property will return the entire secret ``` ### Working with Plain Text ItemValue Fields While Secret-Server/Platform always returns secrets in JSON format with an `Items` array structure, individual field values (stored in `ItemValue`) may contain plain text, passwords, URLs, or other non-JSON content. When retrieving fields that contain plain text values, you can reference them directly by their `FieldName` or `Slug` without needing additional JSON parsing within the `ItemValue`. #### Example with Plain Text Password Field ```yaml apiVersion: external-secrets.io/v1beta1 kind: ExternalSecret metadata: name: secret-server-external-secret spec: refreshInterval: 1h0m0s secretStoreRef: kind: SecretStore name: secret-server-store data: - secretKey: password remoteRef: key: "52622" # Secret ID property: "password" # FieldName or Slug of the password field ``` In this example, if the secret contains an Item with `FieldName: "Password"` or `Slug: "password"`, the plain text value stored in `ItemValue` is retrieved directly and stored under the key `password` in the Kubernetes Secret. This approach works for any field type (text, password, URL, etc.) where the `ItemValue` contains simple content rather than nested JSON structures. ### Support for Fetching Secrets by Path In addition to retrieving secrets by ID or Name, the Secret-Server/Platform provider now supports fetching secrets by \*\*path\*\*. This allows you to specify a secret’s folder hierarchy and name in the format: >/FolderName/SecretName #### Example ```yaml apiVersion: external-secrets.io/v1beta1 kind: ExternalSecret metadata: name: secret-server-external-secret spec: refreshInterval: 15s secretStoreRef: kind: SecretStore name: secret-server-store data: - secretKey: SecretServerValue # Key in the Kubernetes Secret remoteRef: key: "/secretFolder/secretname" # Path format: // property: "" # Optional: use gjson syntax to extract a specific field ``` #### Notes: The path must exactly match the folder and secret name in Secret-Server/Platform. If multiple secrets with the same name exist in different folders, the path helps to uniquely identify the correct one. You can still use property to extract values from JSON-formatted secrets or omit it to retrieve the entire secret. ### Preparing your secret You can either retrieve your entire secret or you can use a JSON formatted string stored in your secret located at Items[0].ItemValue to retrieve a specific value. See example JSON secret below. #### Examples Using the json formatted secret | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/secretserver.md | main | external-secrets | [
-0.05798780918121338,
-0.03800790756940842,
-0.020641056820750237,
-0.09259956330060959,
-0.07898619025945663,
-0.005628624930977821,
0.02610335499048233,
0.01800725609064102,
0.12976372241973877,
0.051242753863334656,
-0.022318782284855843,
-0.0817699059844017,
0.010876324959099293,
-0.07... | 0.0945 |
omit it to retrieve the entire secret. ### Preparing your secret You can either retrieve your entire secret or you can use a JSON formatted string stored in your secret located at Items[0].ItemValue to retrieve a specific value. See example JSON secret below. #### Examples Using the json formatted secret below: - Lookup a single top level property using secret ID. >spec.data.remoteRef.key = 52622 (id of the secret) spec.data.remoteRef.property = "user" (Items.0.ItemValue user attribute) returns: marktwain@hannibal.com - Lookup a nested property using secret name. >spec.data.remoteRef.key = "external-secret-testing" (name of the secret) spec.data.remoteRef.property = "books.1" (Items.0.ItemValue books.1 attribute) returns: huckleberryFinn - Lookup by secret ID (\*secret name will work as well\*) and return the entire secret. >spec.data.remoteRef.key = "52622" (id of the secret) spec.data.remoteRef.property = "" returns: The entire secret in JSON format as displayed below ```JSON { "Name": "external-secret-testing", "FolderID": 73, "ID": 52622, "SiteID": 1, "SecretTemplateID": 6098, "SecretPolicyID": -1, "PasswordTypeWebScriptID": -1, "LauncherConnectAsSecretID": -1, "CheckOutIntervalMinutes": -1, "Active": true, "CheckedOut": false, "CheckOutEnabled": false, "AutoChangeEnabled": false, "CheckOutChangePasswordEnabled": false, "DelayIndexing": false, "EnableInheritPermissions": true, "EnableInheritSecretPolicy": true, "ProxyEnabled": false, "RequiresComment": false, "SessionRecordingEnabled": false, "WebLauncherRequiresIncognitoMode": false, "Items": [ { "ItemID": 280265, "FieldID": 439, "FileAttachmentID": 0, "FieldName": "Data", "Slug": "data", "FieldDescription": "json text field", "Filename": "", "ItemValue": "{ \"user\": \"marktwain@hannibal.com\", \"occupation\": \"author\",\"books\":[ \"tomSawyer\",\"huckleberryFinn\",\"Pudd'nhead Wilson\"] }", "IsFile": false, "IsNotes": false, "IsPassword": false } ] } ``` ### Referencing Secrets in multiple Items secrets If there is more then one Item in the secret, it supports to retrieve them (all Item.\\*.ItemValue) looking up by Item.\\*.FieldName or Item.\\*.Slug, instead of the above behaviour to use gjson only on the first item Items.0.ItemValue only. #### Examples Using the json formatted secret below: - Lookup a single top level property using secret ID. >spec.data.remoteRef.key = 4000 (id of the secret) spec.data.remoteRef.property = "Username" (Items.0.FieldName) returns: usernamevalue - Lookup a nested property using secret name. >spec.data.remoteRef.key = "Secretname" (name of the secret) spec.data.remoteRef.property = "password" (Items.1.slug) returns: passwordvalue - Lookup by secret ID (\*secret name will work as well\*) and return the entire secret. >spec.data.remoteRef.key = "4000" (id of the secret) returns: The entire secret in JSON format as displayed below ```JSON { "Name": "Secretname", "FolderID": 0, "ID": 4000, "SiteID": 0, "SecretTemplateID": 0, "LauncherConnectAsSecretID": 0, "CheckOutIntervalMinutes": 0, "Active": false, "CheckedOut": false, "CheckOutEnabled": false, "AutoChangeEnabled": false, "CheckOutChangePasswordEnabled": false, "DelayIndexing": false, "EnableInheritPermissions": false, "EnableInheritSecretPolicy": false, "ProxyEnabled": false, "RequiresComment": false, "SessionRecordingEnabled": false, "WebLauncherRequiresIncognitoMode": false, "Items": [ { "ItemID": 0, "FieldID": 0, "FileAttachmentID": 0, "FieldName": "Username", "Slug": "username", "FieldDescription": "", "Filename": "", "ItemValue": "usernamevalue", "IsFile": false, "IsNotes": false, "IsPassword": false }, { "ItemID": 0, "FieldID": 0, "FileAttachmentID": 0, "FieldName": "Password", "Slug": "password", "FieldDescription": "", "Filename": "", "ItemValue": "passwordvalue", "IsFile": false, "IsNotes": false, "IsPassword": false } ] } ``` | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/secretserver.md | main | external-secrets | [
-0.09044697880744934,
0.06847245991230011,
-0.035051681101322174,
0.055238377302885056,
-0.012738277204334736,
-0.02393144555389881,
0.037039048969745636,
-0.014271377585828304,
0.05757113918662071,
-0.015919791534543037,
0.03341086953878403,
-0.024130748584866524,
0.03625589609146118,
-0.... | -0.104597 |
# OpenStack Barbican External Secrets Operator integrates with [OpenStack Barbican](https://docs.openstack.org/barbican/latest/) for secret management. Barbican is OpenStack's Key Manager service that provides secure storage, provisioning and management of secret data. This includes keys, passwords, certificates, and other sensitive data. The Barbican provider for External Secrets Operator allows you to retrieve secrets stored in Barbican and synchronize them with Kubernetes secrets. ## Authentication The Barbican provider uses OpenStack Keystone authentication. You need to provide: - \*\*AuthURL\*\*: The OpenStack Keystone authentication endpoint - \*\*TenantName\*\*: The OpenStack tenant/project name - \*\*DomainName\*\*: The OpenStack domain name (optional) - \*\*Region\*\*: The OpenStack region (optional) - \*\*Username\*\*: OpenStack username (stored in a Kubernetes secret) - \*\*Password\*\*: OpenStack password (stored in a Kubernetes secret) ## Example First, create a secret containing your OpenStack credentials: ```yaml apiVersion: v1 kind: Secret metadata: name: barbican-secret type: Opaque data: username: bXl1c2VybmFtZQ== # base64 encoded "myusername" password: bXlwYXNzd29yZA== # base64 encoded "mypassword" ``` Then create a SecretStore with the Barbican backend: ```yaml apiVersion: external-secrets.io/v1 kind: SecretStore metadata: name: barbican-backend spec: provider: barbican: authURL: "https://keystone.example.com:5000/v3" tenantName: "my-project" domainName: "default" region: "RegionOne" auth: username: secretRef: name: "barbican-secret" key: "username" password: secretRef: name: "barbican-secret" key: "password" ``` \*\*NOTE:\*\* In case of a `ClusterSecretStore`, be sure to provide `namespace` for the `secretRef` with the namespace of the secret that contains the credentials. ## Creating an ExternalSecret Now you can create an ExternalSecret that uses the Barbican provider to retrieve secrets: ```yaml apiVersion: external-secrets.io/v1 kind: ExternalSecret metadata: name: barbican-secret spec: secretStoreRef: name: barbican-backend kind: SecretStore target: name: example-secret creationPolicy: Owner data: - secretKey: password remoteRef: key: "my-secret-uuid" ``` The `remoteRef.key` should be the UUID of the secret in Barbican. You can find this by listing secrets in Barbican: ```bash openstack secret list ``` ## Finding Secrets by Name You can also retrieve secrets by using the `find` feature to search by name. It doesnt really support regexp, its exact string matching, so you need to provide the exact name of the secret. ```yaml apiVersion: external-secrets.io/v1 kind: ExternalSecret metadata: name: barbican-find-secret spec: secretStoreRef: name: barbican-backend kind: SecretStore target: name: found-secrets creationPolicy: Owner dataFrom: - find: name: regexp: "database" ``` This will find all secrets in Barbican whose name exactly matches the string. ## ClusterSecretStore For a ClusterSecretStore, you need to specify the namespace where the credentials secret is located: ```yaml apiVersion: external-secrets.io/v1 kind: ClusterSecretStore metadata: name: barbican-cluster-backend spec: provider: barbican: authURL: "https://keystone.example.com:5000/v3" tenantName: "my-project" domainName: "default" region: "RegionOne" auth: username: secretRef: name: "barbican-secret" key: "username" namespace: "default" # Required for ClusterSecretStore password: secretRef: name: "barbican-secret" key: "password" namespace: "default" # Required for ClusterSecretStore ``` ## Configuration Reference | Field | Type | Required | Description | |-------|------|----------|-------------| | `authURL` | string | Yes | OpenStack Keystone authentication endpoint URL | | `tenantName` | string | Yes | OpenStack tenant/project name | | `domainName` | string | No | OpenStack domain name | | `region` | string | No | OpenStack region | | `auth` | BarbicanAuth | Yes | Authentication credentials | ### BarbicanAuth The `BarbicanAuth` type contains the authentication information: | Field | Type | Required | Description | |-------|------|----------|-------------| | `username` | BarbicanProviderUsernameRef | Yes | OpenStack username (from secret or literal value) | | `password` | BarbicanProviderPasswordRef | Yes | OpenStack password (from secret only) | ### BarbicanProviderUsernameRef The `BarbicanProviderUsernameRef` type allows you to specify username either as a literal or reference to a Kubernetes secret: | Field | Type | Required | Description | |-------|------|----------|-------------| | `value` | string | No | Literal value (not recommended for sensitive data) | | `secretRef` | SecretKeySelector | No | Reference to a Kubernetes secret | ### BarbicanProviderPasswordRef | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/barbican.md | main | external-secrets | [
-0.006743426900357008,
-0.016418281942605972,
-0.05726850405335426,
0.0014325461816042662,
-0.07047241181135178,
-0.02837510220706463,
0.007018628064543009,
-0.010621536523103714,
0.059087369590997696,
0.038588736206293106,
0.02019454538822174,
-0.10832322388887405,
0.014417069964110851,
-... | 0.034214 |
either as a literal or reference to a Kubernetes secret: | Field | Type | Required | Description | |-------|------|----------|-------------| | `value` | string | No | Literal value (not recommended for sensitive data) | | `secretRef` | SecretKeySelector | No | Reference to a Kubernetes secret | ### BarbicanProviderPasswordRef The `BarbicanProviderPasswordRef` type requires a reference to a Kubernetes secret: | Field | Type | Required | Description | |-------|------|----------|-------------| | `secretRef` | SecretKeySelector | Yes | Reference to a Kubernetes secret | ## Limitations - The Barbican provider is \*\*read-only\*\*. It does not support creating or updating secrets in Barbican. - Used credentials has to have access to the provided secret. - It will retrieve all secret types by default. ## Troubleshooting ### Authentication Issues If you encounter authentication errors, verify: 1. The `authURL` is correct and accessible 2. The credentials are valid and have appropriate permissions 3. The `tenantName` and `domainName` (if used) are correct 4. Network connectivity to the OpenStack endpoints ### Secret Not Found If a secret cannot be found: 1. Verify the secret UUID exists in Barbican: `openstack secret get -p https://barbican-url/v1/secrets/` 2. Check that the user has permission to access the secret 3. Ensure the secret is in the correct project/tenant ### Network Connectivity Ensure your Kubernetes cluster can reach: - The OpenStack Keystone endpoint (for authentication) - The Barbican service endpoint (for secret retrieval) Check firewall rules and network policies that might block access. | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/barbican.md | main | external-secrets | [
-0.06944756954908371,
-0.027511052787303925,
-0.029770739376544952,
-0.004231683909893036,
-0.07222668826580048,
0.03125007078051567,
0.046419862657785416,
-0.03752298280596733,
0.07122556865215302,
0.013921785168349743,
0.024503281340003014,
-0.13112621009349823,
0.08256369829177856,
-0.0... | 0.03306 |
## GitLab Variables External Secrets Operator integrates with GitLab to sync [GitLab Project Variables API](https://docs.gitlab.com/ee/api/project\_level\_variables.html) and/or [GitLab Group Variables API](https://docs.gitlab.com/ee/api/group\_level\_variables.html) to secrets held on the Kubernetes cluster. ### Configuring GitLab The GitLab API requires an access token, project ID and/or groupIDs. To create a new access token, go to your user settings and select 'access tokens'. Give your token a name, expiration date, and select the permissions required (Note 'api' is required).  Click 'Create personal access token', and your token will be generated and displayed on screen. Copy or save this token since you can't access it again.  ### Access Token secret Create a secret containing your access token: ```yaml {% include 'gitlab-credentials-secret.yaml' %} ``` ### Configuring the secret store Be sure the `gitlab` provider is listed in the `Kind=SecretStore` and the ProjectID is set. If you are not using `https://gitlab.com`, you must set the `url` field as well. In order to sync group variables `inheritFromGroups` must be true or `groupIDs` have to be defined. In case you have defined multiple environments in Gitlab, the secret store should be constrained to a specific `environment\_scope`. #### Environment Scope Fallback Behavior The GitLab provider implements an intelligent fallback mechanism for environment scopes: 1. \*\*Primary lookup\*\*: When you configure a specific `environment` in your SecretStore (example: `environment: "production"`), the provider first tries to find variables with that exact environment scope. 2. \*\*Automatic fallback\*\*: If no variable is found with the specific environment scope, the provider automatically falls back to variables with "All environments" scope (`\*` wildcard). 3. \*\*Priority order\*\*: Variables with specific environment scopes take precedence over wildcard variables when both exist. \*\*Example\*\*: If your SecretStore has `environment: "production"` but your GitLab variable is set to "All environments", the variable will still be successfully retrieved through the fallback mechanism. > \*\*Implementation Note\*\*: This fallback behavior is implemented in the [`getVariables` function](https://github.com/external-secrets/external-secrets/blob/636ce0578dda4a623a681066def8998a68b051a6/pkg/provider/gitlab/provider.go#L134-L151) where the provider automatically retries with `EnvironmentScope: "\*"` when the initial lookup with the specific environment scope returns a 404 Not Found response. ```yaml {% include 'gitlab-secret-store.yaml' %} ``` \*\*NOTE:\*\* In case of a `ClusterSecretStore`, Be sure to provide `namespace` in `accessToken` with the namespace where the secret resides. Your project ID can be found on your project's page.  ### Creating external secret To sync a GitLab variable to a secret on the Kubernetes cluster, a `Kind=ExternalSecret` is needed. ```yaml {% include 'gitlab-external-secret.yaml' %} ``` #### Using DataFrom DataFrom can be used to get a variable as a JSON string and attempt to parse it. ```yaml {% include 'gitlab-external-secret-json.yaml' %} ``` ### Getting the Kubernetes secret The operator will fetch the project variable and inject it as a `Kind=Secret`. ``` kubectl get secret gitlab-secret-to-create -o jsonpath='{.data.secretKey}' | base64 -d ``` | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/gitlab-variables.md | main | external-secrets | [
-0.07571767270565033,
-0.0354902483522892,
-0.002003950532525778,
0.06628520786762238,
-0.07911981642246246,
-0.04381893202662468,
0.012180798687040806,
-0.012773162685334682,
0.07989897578954697,
0.013750996440649033,
-0.020200179889798164,
-0.05165150761604309,
0.08644735813140869,
-0.01... | 0.058988 |
 ## Previder Secret Vault Manager External Secrets Operator integrates with [Previder Secrets Vault](https://vault.previder.io) for secure secret management. ### Authentication We support Access Token authentication using a Secrets Vault ReadWrite or ReadOnly token. This token can be created with the [vault-cli](https://github.com/previder/vault-cli) using an Environment token which can be acquired via the [Previder Portal](https://portal.previder.nl). #### Access Token authentication To use the access token, first create it as a regular Kubernetes Secret and then associate it with the Previder Secret Store. ```yaml apiVersion: v1 kind: Secret metadata: name: previder-vault-sample-secret data: previder-vault-token: cHJldmlkZXIgdmF1bHQgZXhhbXBsZQ== ``` ```yaml apiVersion: external-secrets.io/v1 kind: SecretStore metadata: name: previder-secretstore-sample spec: provider: previder: auth: secretRef: accessToken: name: previder-vault-sample-secret key: previder-vault-token ``` ### Creating external secret To create a kubernetes secret from the Previder Secret Vault, create an ExternalSecret with a reference to a Vault secret. ```yaml apiVersion: external-secrets.io/v1 kind: ExternalSecret metadata: name: example spec: refreshInterval: 1h0m0s secretStoreRef: name: previder-secretstore-sample kind: SecretStore target: name: example-secret creationPolicy: Owner data: - secretKey: local-secret-key remoteRef: key: token-name-or-id ``` | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/previder.md | main | external-secrets | [
-0.05124303326010704,
0.020502930507063866,
-0.02131614275276661,
-0.018382349982857704,
-0.007361092139035463,
-0.009890582412481308,
-0.04813012108206749,
0.04080408811569214,
0.0875934362411499,
0.04048881679773331,
0.013143221847712994,
-0.02906690537929535,
0.01069750264286995,
0.0179... | 0.058682 |
 ## Cloak Sync secrets from the [Cloak Encrypted Secrets Platform](https://cloak.software) to Kubernetes using the External Secrets Operator. Cloak uses the webhook provider built into the External Secrets Operator but also required a proxy service to handle decrypting secrets when they arrive into your cluster. ## Key Setup From the Cloak user interface [create a service account](https://cloak.software/docs/getting-started/03-cli/) and store the private key on your file system. Now create a kubernetes secret in the same namespace as the External Secrets Operator. ```sh HISTIGNORE='\*kubectl\*' kubectl --namespace=external-secrets \ create secret generic cloak-key \ --from-file=ecdh\_private\_key=$LOCATION\_OF\_YOUR\_PEM\_FILE ``` ## Deploy the decryption proxy ```yaml {% include 'cloak-proxy-deployment.yaml' %} ``` And a Kubernetes Service so External Secrets Operator can access the proxy. ```yaml {% include 'cloak-proxy-service.yaml' %} ``` ## Create a secret store You can now place the configuration in any Kubernetes Namespace. ```yaml {% include 'cloak-secret-store.yaml' %} ``` ## Connect a secret to the provider Each `secretKey` reference in the yaml should point to the name of the secret as it is stored in Cloak. ```yaml {% include 'cloak-external-secret.yaml' %} ``` | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/cloak.md | main | external-secrets | [
-0.06053736060857773,
0.07714176177978516,
-0.02374560385942459,
0.012087980285286903,
0.012444738298654556,
-0.04069623351097107,
0.004531500861048698,
-0.0035823064390569925,
0.040560316294431686,
0.0007063740049488842,
0.02058122120797634,
-0.09927541017532349,
0.05442880466580391,
-0.0... | 0.110155 |
## Akeyless Secrets Management Platform External Secrets Operator integrates with the [Akeyless Secrets Management Platform](https://www.akeyless.io/). ### Create Secret Store SecretStore resource specifies how to access Akeyless. This resource is namespaced. \*\*NOTE:\*\* Make sure the Akeyless provider is listed in the Kind=SecretStore. If you use a customer fragment, define the value of akeylessGWApiURL as the URL of your Akeyless Gateway in the following format: https://your.akeyless.gw:8080/v2. Akeyelss provide several Authentication Methods: ### Authentication with Kubernetes Options for obtaining Kubernetes credentials include: 1. Using a service account jwt referenced in serviceAccountRef 2. Using the jwt from a Kind=Secret referenced by the secretRef 3. Using transient credentials from the mounted service account token within the external-secrets operator #### Create the Akeyless Secret Store Provider with Kubernetes Auth-Method ```yaml {% include 'akeyless-secret-store-k8s-auth.yaml' %} ``` \*\*NOTE:\*\* In case of a `ClusterSecretStore`, Be sure to provide `namespace` for `serviceAccountRef` and `secretRef` according to the namespaces where the secrets reside. ### Authentication With Cloud-Identity or Api-Access-Key Akeyless providers require an access-id, access-type and access-Type-param To set your SecretStore with an authentication method from Akeyless. The supported auth-methods and their parameters are: | accessType | accessTypeParam | | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `aws\_iam` | - | | `gcp` | The gcp audience | | `azure\_ad` | azure object id (optional) | | `api\_key` | The access key. | | `k8s` | The k8s configuration name | For more information see [Akeyless Authentication Methods](https://docs.akeyless.io/docs/access-and-authentication-methods) #### Creating an Akeyless Credentials Secret Create a secret containing your credentials using the following example as a guide: ```yaml apiVersion: v1 kind: Secret metadata: name: akeyless-secret-creds type: Opaque stringData: accessId: "p-XXXX" accessType: # gcp/azure\_ad/api\_key/k8s/aws\_iam accessTypeParam: # optional: can be one of the following: gcp-audience/azure-obj-id/access-key/k8s-conf-name ``` #### Create the Akeyless Secret Store Provider with the Credentials Secret ```yaml {% include 'akeyless-secret-store.yaml' %} ``` \*\*NOTE:\*\* In case of a `ClusterSecretStore`, be sure to provide `namespace` for `accessID`, `accessType` and `accessTypeParam` according to the namespaces where the secrets reside. #### Create the Akeyless Secret Store With CAs for TLS handshake ```yaml .... spec: provider: akeyless: akeylessGWApiURL: "https://your.akeyless.gw:8080/v2" # Optional caBundle - PEM/base64 encoded CA certificate caBundle: "" # Optional caProvider: # Instead of caBundle you can also specify a caProvider # this will retrieve the cert from a Secret or ConfigMap caProvider: type: "Secret/ConfigMap" # Can be Secret or ConfigMap name: "" key: "" # namespace is mandatory for ClusterSecretStore and not relevant for SecretStore namespace: "my-cert-secret-namespace" .... ``` ### Creating an external secret To get a secret from Akeyless and create it as a secret on the Kubernetes cluster, a `Kind=ExternalSecret` is needed. ```yaml {% include 'akeyless-external-secret.yaml' %} ``` #### Using DataFrom DataFrom can be used to get a secret as a JSON string and attempt to parse it. ```yaml {% include 'akeyless-external-secret-json.yaml' %} ``` ### Getting the Kubernetes Secret The operator will fetch the secret and inject it as a `Kind=Secret`. ```bash kubectl get secret database-credentials -o jsonpath='{.data.db-password}' | base64 -d ``` ```bash kubectl get secret database-credentials-json -o jsonpath='{.data}' ``` ### Pushing a secret To push a secret from Kubernetes cluster and create it as a secret to Akeyless, a `Kind=PushSecret` resource is needed. {% include 'akeyless-push-secret.yaml' %} Then when you create a matching secret as follows: ```bash kubectl create secret generic --from-literal=cache-pass=mypassword k8s-created-secret ``` Then it will create a secret in akeyless `eso-created/my-secret` with value `{"cache-pass":"mypassword"}` | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/akeyless.md | main | external-secrets | [
-0.10358253866434097,
-0.000488156802020967,
-0.03691299632191658,
0.001503564533777535,
-0.0810425728559494,
0.0019145479891449213,
0.03781382367014885,
0.006121672224253416,
0.06669127941131592,
0.025353072211146355,
0.00694845337420702,
-0.01257121842354536,
0.034053005278110504,
-0.025... | 0.091294 |
value `{"cache-pass":"mypassword"}` | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/akeyless.md | main | external-secrets | [
-0.003289619693532586,
0.06804825365543365,
-0.05520779266953468,
-0.0062978737987577915,
-0.07690947502851486,
-0.0465351901948452,
0.07241528481245041,
-0.020514938980340958,
0.016656385734677315,
0.027580924332141876,
-0.06872738152742386,
-0.00687700929120183,
0.02731538750231266,
-0.0... | 0.020699 |
## CyberArk Secrets Manager Provider This section describes how to set up the CyberArk Secrets Manager provider for External Secrets Operator (ESO). For a working example, see the [Accelerator-K8s-External-Secrets repo](https://github.com/conjurdemos/Accelerator-K8s-External-Secrets). ### Prerequisites Before installing the Secrets Manager provider, you need: \* A running instance of [Conjur OSS](https://github.com/cyberark/conjur) or CyberArk Secrets Manager, with: \* An accessible Secrets Manager endpoint (for example: `https://myapi.example.com`). \* Your configured Secrets Manager authentication info (such as `hostid`, `apikey`, or JWT service ID). For more information on configuring Secrets Manager, see [Policy statement reference](https://docs.cyberark.com/conjur-open-source/Latest/en/Content/Operations/Policy/policy-statement-ref.htm). \* Support for your authentication method (`apikey` is supported by default, `jwt` requires additional configuration). \* \*\*Optional\*\*: Secrets Manager server certificate (see [below](#conjur-server-certificate)). \* A Kubernetes cluster with ESO installed. ### Secrets Manager server certificate If you set up your Secrets Manager server with a self-signed certificate, we recommend that you populate the `caBundle` field with the Secrets Manager self-signed certificate in the secret-store definition. The certificate CA must be referenced in the secret-store definition using either `caBundle` or `caProvider`: ```yaml {% include 'conjur-ca-bundle.yaml' %} ``` ### External secret store The Secrets Manager provider is configured as an external secret store in ESO. The Secrets Manager provider supports these two methods to authenticate to Secrets Manager: \* [`apikey`](#option-1-external-secret-store-with-apikey-authentication): uses a Secrets Manager `hostid` and `apikey` to authenticate with Secrets Manager \* [`jwt`](#option-2-external-secret-store-with-jwt-authentication): uses a JWT to authenticate with Secrets Manager #### Option 1: External secret store with apiKey authentication This method uses a Secrets Manager `hostid` and `apikey` to authenticate with Secrets Manager. It is the simplest method to set up and use because your Secrets Manager instance requires no additional configuration. ##### Step 1: Define an external secret store !!! Tip Save as the file as: `conjur-secret-store.yaml` ```yaml {% include 'conjur-secret-store-apikey.yaml' %} ``` ##### Step 2: Create Kubernetes secrets for Secrets Manager credentials To connect to the Secrets Manager server, the \*\*ESO Secrets Manager provider\*\* needs to retrieve the `apikey` credentials from K8s secrets. !!! Note For more information about how to create K8s secrets, see [Creating a secret](https://kubernetes.io/docs/concepts/configuration/secret/#creating-a-secret). Here is an example of how to create K8s secrets using the `kubectl` command: ```shell # This is all one line kubectl -n external-secrets create secret generic conjur-creds --from-literal=hostid=MYCONJURHOSTID --from-literal=apikey=MYAPIKEY # Example: # kubectl -n external-secrets create secret generic conjur-creds --from-literal=hostid=host/data/app1/host001 --from-literal=apikey=321blahblah ``` !!! Note `conjur-creds` is the `name` defined in the `userRef` and `apikeyRef` fields of the `conjur-secret-store.yml` file. ##### Step 3: Create the external secrets store !!! Important Unless you are using a [ClusterSecretStore](../api/clustersecretstore.md), credentials must reside in the same namespace as the SecretStore. ```shell # WARNING: creates the store in the "external-secrets" namespace, update the value as needed # kubectl apply -n external-secrets -f conjur-secret-store.yaml # WARNING: running the delete command will delete the secret store configuration # # If there is a need to delete the external secretstore # kubectl delete secretstore -n external-secrets conjur ``` #### Option 2: External secret store with JWT authentication This method uses JWT tokens to authenticate with Secrets Manager. You can use the following methods to retrieve a JWT token for authentication: \* JWT token from a referenced Kubernetes service account \* JWT token stored in a Kubernetes secret ##### Step 1: Define an external secret store When you use JWT authentication, the following must be specified in the `SecretStore`: \* `account` - The name of the Secrets Manager account \* `serviceId` - The ID of the JWT Authenticator `WebService` configured in Secrets Manager that is used to authenticate the JWT token You can retrieve the JWT token from either a referenced service account or a Kubernetes secret. For example, to retrieve a | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/conjur.md | main | external-secrets | [
-0.1359560489654541,
-0.01803586259484291,
-0.05695882812142372,
-0.004841904621571302,
-0.05784664675593376,
-0.0679401233792305,
-0.025182431563735008,
0.05154069885611534,
-0.03400499373674393,
-0.007099160924553871,
0.026173939928412437,
-0.057932622730731964,
0.007498173974454403,
0.0... | 0.142916 |
The name of the Secrets Manager account \* `serviceId` - The ID of the JWT Authenticator `WebService` configured in Secrets Manager that is used to authenticate the JWT token You can retrieve the JWT token from either a referenced service account or a Kubernetes secret. For example, to retrieve a JWT token from a referenced Kubernetes service account, the following secret store definition can be used: ```yaml {% include 'conjur-secret-store-jwt-service-account-ref.yaml' %} ``` !!! Important This method is only supported in Kubernetes 1.22 and above as it uses the [TokenRequest API](https://kubernetes.io/docs/reference/kubernetes-api/authentication-resources/token-request-v1/) to get the JWT token from the referenced service account. Audiences can be defined in the [Secrets Manager JWT authenticator](https://docs.conjur.org/Latest/en/Content/Integrations/k8s-ocp/k8s-jwt-authn.htm). Alternatively, here is an example where a secret containing a valid JWT token is referenced: ```yaml {% include 'conjur-secret-store-jwt-secret-ref.yaml' %} ``` The JWT token must identify your Secrets Manager host, be compatible with your configured Secrets Manager JWT authenticator, and meet all the [Secrets Manager JWT guidelines](https://docs.conjur.org/Latest/en/Content/Operations/Services/cjr-authn-jwt-guidelines.htm#Best). You can use an external JWT issuer or the Kubernetes API server to create the token. For example, a Kubernetes service account token can be created with this command: ```shell kubectl create token my-service-account --audience='https://conjur.company.com' --duration=3600s ``` Save the secret store file as `conjur-secret-store.yaml`. ##### Step 2: Create the external secrets store ```shell # WARNING: creates the store in the "external-secrets" namespace, update the value as needed # kubectl apply -n external-secrets -f conjur-secret-store.yaml # WARNING: running the delete command will delete the secret store configuration # # If there is a need to delete the external secretstore # kubectl delete secretstore -n external-secrets conjur ``` ### Define an external secret After you have configured the Secrets Manager provider secret store, you can fetch secrets from Secrets Manager. Here is an example of how to fetch a single secret from Secrets Manager: ```yaml {% include 'conjur-external-secret.yaml' %} ``` Save the external secret file as `conjur-external-secret.yaml`. #### Find by Name and Find by Tag The Secrets Manager provider also supports the Find by Name and Find by Tag ESO features. This means that you can use a regular expression or tags to dynamically fetch multiple secrets from Secrets Manager. ```yaml {% include 'conjur-external-secret-find.yaml' %} ``` If you use these features, we strongly recommend that you limit the permissions of the Secrets Manager host to only the secrets that it needs to access. This is more secure and it reduces the load on both the Secrets Manager server and ESO. ### Create the external secret ```shell # WARNING: creates the external-secret in the "external-secrets" namespace, update the value as needed # kubectl apply -n external-secrets -f conjur-external-secret.yaml # WARNING: running the delete command will delete the external-secrets configuration # # If there is a need to delete the external secret # kubectl delete externalsecret -n external-secrets conjur ``` ### Get the K8s secret \* Log in to your Secrets Manager server and verify that your secret exists \* Review the value of your Kubernetes secret to verify that it contains the same value as the Secrets Manager server ```shell # WARNING: this command will reveal the stored secret in plain text # # Assuming the secret name is "secret00", this will show the value kubectl get secret -n external-secrets conjur -o jsonpath="{.data.secret00}" | base64 --decode && echo ``` ### See also \* [Accelerator-K8s-External-Secrets repo](https://github.com/conjurdemos/Accelerator-K8s-External-Secrets) \* [Configure Secrets Manager JWT authentication](https://docs.cyberark.com/conjur-open-source/Latest/en/Content/Operations/Services/cjr-authn-jwt-guidelines.htm) ### License Copyright (c) 2023-2024 CyberArk Software Ltd. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/conjur.md | main | external-secrets | [
-0.07559900730848312,
0.014956430532038212,
0.027452468872070312,
-0.02169845625758171,
-0.004755516070872545,
-0.027616966515779495,
0.057642702013254166,
-0.0064376420341432095,
0.08443368226289749,
-0.010319816879928112,
-0.04082687571644783,
-0.07862426340579987,
0.047211114317178726,
... | 0.080572 |
[Configure Secrets Manager JWT authentication](https://docs.cyberark.com/conjur-open-source/Latest/en/Content/Operations/Services/cjr-authn-jwt-guidelines.htm) ### License Copyright (c) 2023-2024 CyberArk Software Ltd. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/conjur.md | main | external-secrets | [
-0.17875006794929504,
0.004472642205655575,
-0.051279667764902115,
-0.0920523852109909,
-0.01597430743277073,
-0.035312823951244354,
-0.036850474774837494,
0.00047968648141250014,
-0.009666175581514835,
-0.06413164734840393,
0.05825534090399742,
-0.017894571647047997,
0.018997984007000923,
... | 0.104437 |
## Devolutions Server (DVLS) External Secrets Operator integrates with [Devolutions Server](https://devolutions.net/server/) (DVLS) for secret management. DVLS is a self-hosted privileged access management solution that provides secure password management, role-based access control, and credential injection for teams and enterprises. ## Authentication DVLS authentication uses Application ID and Application Secret credentials. ### Creating an Application in DVLS 1. Log into your DVLS web interface 2. Navigate to \*\*Administration > Applications identities\*\* 3. Click \*\*+ (Add)\*\* to create a new application 4. Configure the application with appropriate permissions to access the vaults and entries you need 5. Save the \*\*Application ID\*\* and \*\*Application Secret\*\* ### Creating the Kubernetes Secret Create a Kubernetes secret containing your DVLS credentials: ```bash kubectl create secret generic dvls-credentials \ --from-literal=app-id="your-application-id" \ --from-literal=app-secret="your-application-secret" ``` ### Creating a SecretStore ```yaml {% include 'dvls-secret-store.yaml' %} ``` | Field | Description | |-------|-------------| | `serverUrl` | The URL of your DVLS instance (e.g., `https://dvls.example.com`) | | `insecure` | (Optional) Set to `true` to allow plain HTTP connections. \*\*Not recommended for production.\*\* | | `auth.secretRef.appId` | Reference to the secret containing the Application ID | | `auth.secretRef.appSecret` | Reference to the secret containing the Application Secret | \*\*NOTE:\*\* For `ClusterSecretStore`, ensure you specify the `namespace` in the secret references. ## Referencing Secrets Secrets are referenced using the format: `/` - \*\*vault-id\*\*: The UUID of the vault containing the entry - \*\*entry-id\*\*: The UUID of the credential entry You can find these UUIDs in the DVLS web interface by viewing the entry properties. ## Supported Credential Types DVLS supports multiple credential types. The provider maps each type to specific properties: | Credential Type | DVLS Entry Type | Available Properties | |-----------------|-----------------|---------------------| | \*\*Default\*\* | Credential | `username`, `password`, `domain` | | \*\*Access Code\*\* | Secret | `password` | | \*\*API Key\*\* | Credential | `api-id`, `api-key`, `tenant-id` | | \*\*Azure Service Principal\*\* | Credential | `client-id`, `client-secret`, `tenant-id` | | \*\*Connection String\*\* | Credential | `connection-string` | | \*\*Private Key\*\* | Credential | `username`, `password`, `private-key`, `public-key`, `passphrase` | All entries also include `entry-id` and `entry-name` metadata properties. \*\*Note:\*\* When no `property` is specified, the `password` field is returned by default. \*\*Note:\*\* In the DVLS web interface, "Secret" entries appear as a distinct entry type and are mapped to the Access Code credential subtype internally. ## Examples ### Fetching Individual Properties To fetch specific properties from a credential entry: ```yaml {% include 'dvls-external-secret.yaml' %} ``` ### Using dataFrom to Extract All Fields When using `dataFrom.extract`, all available properties from the credential entry will be synced to the Kubernetes secret. ## Push Secrets The DVLS provider supports pushing secrets back to DVLS: ```yaml {% include 'dvls-push-secret.yaml' %} ``` \*\*Note:\*\* Push secret updates an existing entry's password field. The entry must already exist in DVLS. ## Limitations - \*\*GetAllSecrets\*\*: The `find` operation for discovering secrets is not currently supported - \*\*Custom CA Certificates\*\*: Custom TLS certificates for self-signed DVLS instances are not yet supported. Use the `SSL\_CERT\_FILE` environment variable as a workaround - \*\*Name-based lookups\*\*: Currently only UUID-based references (`vault-id/entry-id`) are supported. Path/name-based lookups are planned for future releases - \*\*Certificate entries\*\*: Certificate entry types (`Document/Certificate`) are not currently supported. Only Credential entries are supported ## Troubleshooting ### Authentication Errors If you receive authentication errors: 1. Verify the Application ID and Secret are correct 2. Ensure the application has the necessary permissions in DVLS 3. Check that the DVLS server URL is accessible from your Kubernetes cluster ### Entry Not Found If an entry cannot be found: 1. Verify the vault UUID and entry UUID are correct 2. Ensure the application has at least read | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/devolutions-server.md | main | external-secrets | [
-0.01338160689920187,
0.04267822951078415,
-0.060676608234643936,
-0.07429803907871246,
-0.08567935973405838,
-0.04757644608616829,
0.011339214630424976,
0.00018099079898092896,
0.08999573439359665,
0.016601350158452988,
-0.0467761754989624,
-0.0970359817147255,
0.053903978317976,
-0.00010... | 0.06544 |
Ensure the application has the necessary permissions in DVLS 3. Check that the DVLS server URL is accessible from your Kubernetes cluster ### Entry Not Found If an entry cannot be found: 1. Verify the vault UUID and entry UUID are correct 2. Ensure the application has at least read access to the vault 3. Check that the entry exists and is a Credential or Secret type entry 4. Ensure the application has at least read, view password, and connect (execute) permissions on the entry. | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/devolutions-server.md | main | external-secrets | [
0.04059154912829399,
-0.017781861126422882,
-0.0106728570535779,
-0.08385089039802551,
-0.04060849919915199,
-0.05602486804127693,
-0.08475140482187271,
-0.050249237567186356,
0.14883746206760406,
0.015788359567523003,
-0.05511965975165367,
-0.10666946321725845,
0.001616648631170392,
0.019... | -0.032962 |
## Scaleway Secret Manager External Secrets Operator integrates with [Scaleway's Secret Manager](https://developers.scaleway.com/en/products/secret\_manager/api/v1alpha1/). ### Creating a SecretStore You need an api key (access key + secret key) to authenticate with the secret manager. Both access and secret keys can be specified either directly in the config, or by referencing a kubernetes secret. ```yaml apiVersion: external-secrets.io/v1 kind: SecretStore metadata: name: secret-store spec: provider: scaleway: region: projectId: accessKey: value: secretKey: secretRef: name: key: ``` ### Referencing Secrets Secrets can be referenced by name, id or path, using the prefixes `"name:"`, `"id:"` and `"path:"` respectively. A PushSecret resource can only use a name reference. ```yaml apiVersion: external-secrets.io/v1 kind: ExternalSecret metadata: name: secret spec: refreshInterval: 1h0m0s secretStoreRef: kind: SecretStore name: secret-store data: - secretKey: remoteRef: key: id: version: latest\_enabled ``` ### JSON Secret Values Scaleway Secret Manager supports storing JSON objects as secrets. You can access values using [gjson syntax](https://github.com/tidwall/gjson/blob/master/SYNTAX.md): Consider the following JSON object that is stored in a Scaleway secret: ```json { "first": "Tom", "last": "Anderson" } ``` This is an example on how you would look up keys in the above JSON object: ```yaml apiVersion: external-secrets.io/v1 kind: ExternalSecret metadata: name: extract-data spec: refreshInterval: 1h0m0s secretStoreRef: kind: SecretStore name: secret-store target: name: secret-data creationPolicy: Owner data: - secretKey: first\_name remoteRef: key: id: property: first # Tom - secretKey: last\_name remoteRef: key: id: property: last # Anderson ``` | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/scaleway.md | main | external-secrets | [
-0.04819730296730995,
-0.0461166687309742,
-0.005697818472981453,
0.013765565119683743,
-0.05148005858063698,
0.013831368647515774,
-0.023064788430929184,
0.04970748350024223,
0.0631479024887085,
0.036765534430742264,
0.04258817061781883,
-0.08320979028940201,
0.018834182992577553,
0.00253... | 0.055938 |
## Fortanix DSM / SDKMS Populate kubernetes secrets from OPAQUE or SECRET security objects in Fortanix. ### Authentication SDKMS [Application API Key](https://support.fortanix.com/hc/en-us/articles/360015941132-Authentication) ### Creating a SecretStore ```yaml apiVersion: external-secrets.io/v1 kind: SecretStore metadata: name: secret-store spec: provider: fortanix: apiUrl: apiKey: secretRef: name: key: ``` ### Referencing Secrets ```yaml # Raw stored value apiVersion: external-secrets.io/v1 kind: ExternalSecret metadata: name: secret spec: refreshInterval: 1h0m0s secretStoreRef: kind: SecretStore name: secret-store data: - secretKey: remoteRef: key: --- # From stored key-value JSON apiVersion: external-secrets.io/v1 kind: ExternalSecret metadata: name: secret-from-property spec: refreshInterval: 1h0m0s secretStoreRef: kind: SecretStore name: secret-store data: - secretKey: remoteRef: key: property: --- # Extract all keys from stored key-value JSON apiVersion: external-secrets.io/v1 kind: ExternalSecret metadata: name: secret-from-extract spec: refreshInterval: 1h0m0s secretStoreRef: kind: SecretStore name: secret-store dataFrom: - extract: key: ``` | https://github.com/external-secrets/external-secrets/blob/main//docs/provider/fortanix.md | main | external-secrets | [
-0.039407748728990555,
-0.02582106739282608,
-0.010955640114843845,
0.03751459717750549,
0.00623296620324254,
-0.01828470453619957,
0.015783945098519325,
0.023730656132102013,
0.04462156072258949,
0.02181491069495678,
0.005955431144684553,
-0.055304136127233505,
-0.01344214379787445,
-0.00... | 0.113935 |
# Decoding Strategies The External Secrets Operator has the feature to allow multiple decoding strategies during an object generation. The `decodingStrategy` field allows the user to set the following Decoding Strategies based on their needs. `decodingStrategy` can be placed under `spec.data.remoteRef`, `spec.dataFrom.extract` or `spec.dataFrom.find`. It will configure the decoding strategy for that specific operation, leaving others with the default behavior if not set. ### None (default) ESO will not try to decode the secret value. ### Base64 ESO will try to decode the secret value using [base64](https://datatracker.ietf.org/doc/html/rfc4648#section-4) method. If the decoding fails, an error is produced. ### Base64URL ESO will try to decode the secret value using [base64url](https://datatracker.ietf.org/doc/html/rfc4648#section-5) method. If the decoding fails, an error is produced. ### Auto ESO will try to decode using Base64/Base64URL strategies. If the decoding fails, ESO will apply decoding strategy None. No error is produced to the user. ## Examples ### Setting Decoding strategy Auto in a DataFrom.Extract Given that we have the given secret information: ``` { "name": "Gustavo", "surname": "Fring", "address":"aGFwcHkgc3RyZWV0", } ``` if we apply the following dataFrom: ``` spec: dataFrom: - extract: key: my-secret decodingStrategy: Auto ``` It will render the following Kubernetes Secret: ``` data: name: R3VzdGF2bw== #Gustavo surname: RnJpbmc= #Fring address: aGFwcHkgc3RyZWV0 #happy street ``` ## Limitations At this time, decoding Strategy Auto is only trying to check if the original input is valid to perform Base64 operations. As there is no reliable way to detect base64 encoded values, this means that some non-encoded secret values might end up being decoded, producing gibberish. For example, this is the case for alphanumeric values with a length divisible by 4, like `1234` or `happy/street`. !!! note If you are using `decodeStrategy: Auto` and start to see ESO pulling completely wrong secret values into your kubernetes secret, consider changing it to `None` to investigate it. | https://github.com/external-secrets/external-secrets/blob/main//docs/guides/decoding-strategy.md | main | external-secrets | [
-0.09202493727207184,
-0.012120874598622322,
-0.06205359473824501,
0.034700486809015274,
0.053079769015312195,
-0.10273438692092896,
-0.0291459858417511,
0.012971686199307442,
0.002168691251426935,
0.036939457058906555,
-0.020509939640760422,
-0.010476484894752502,
0.0052686757408082485,
-... | 0.145633 |
## Background The External Secrets Operator is a Kubernetes Operator that seamlessly incorporates external secret management systems into Kubernetes. This Operator retrieves data from the external API and generates Kubernetes Secret resources using the corresponding secret values. This process occurs continuously in the background through regular polling of the external API. Consequently, whenever a secret undergoes changes in the external API, the corresponding Kubernetes Secret will also be updated accordingly. ### Summary | Purpose | Description | | ------------------- | ---------------------------- | | Intended Usage | Sync Secrets into Kubernetes | | Data Classifiation | Critical | | Highest Risk Impact | Organisation takeover | ### Components ESO comprises three main components: `webhook`, `cert controller` and a `core controller`. For more detailed information, please refer to the documentation on [components](../api/components.md). ## Overview This section provides an overview of the security aspects of the External Secrets Operator (ESO) and includes information on assets, threats, and controls involved in its operation. The following diagram illustrates the security perspective of how ESO functions, highlighting the assets (items to protect), threats (potential risks), and controls (measures to mitigate threats).  ### Scope For the purpose of this threat model, we assume an ESO installation using helm and default settings on a public cloud provider. It is important to note that the [Kubernetes SIG Security](https://github.com/kubernetes/community/tree/master/sig-security) team has defined an [Admission Control Threat Model](https://github.com/kubernetes/sig-security/blob/main/sig-security-docs/papers/admission-control/kubernetes-admission-control-threat-model.md), which is recommended reading for a better understanding of the security aspects that partially apply to External Secrets Operator. ESO utilizes the `ValidatingWebhookConfiguration` mechanism to validate `(Cluster)SecretStore` and `(Cluster)ExternalSecret` resources. However, it is essential to understand that this validation process does not serve as a security control mechanism. Instead, ESO performs validation by enforcing additional rules that go beyond the [CustomResourceDefinition OpenAPI v3 Validation schema](https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#validation). ### Assets #### A01: Cluster-Level access to secrets The controller possesses privileged access to the `kube-apiserver` and is authorized to read and write secret resources across all namespaces within a cluster. #### A02: CRD and Webhook Write access The cert-controller component has read/write access to `ValidatingWebhookConfigurations` and `CustomResourceDefinitions` resources. This access is necessary to inject/modify the caBundle property. #### A03: secret provider access The `core-controller` component accesses a secret provider using user-supplied credentials. These credentials can be derived from environment variables, mounted service account tokens, files within the controller container, or fetched from the Kubernetes API (e.g., `Kind=Secret`). The scope of these credentials may vary, potentially providing full access to a cloud provider. #### A04: capability to modify resources The webhook component validates and converts ExternalSecret and SecretStore resources. The conversion webhook is essential for migrating resources from the old version `v1alpha1` to the new version `v1beta1`. The webhook component possesses the ability to modify resources during runtime. ### Threats #### T01: Tampering with resources through MITM An adversary could launch a Man-in-the-Middle (MITM) attack to hijack the webhook pod, enabling them to manipulate the data of the conversion webhook. This could involve injecting malicious resources or causing a Denial-of-Service (DoS) attack. To mitigate this threat, a mutual authentication mechanism should be enforced for the connection between the Kubernetes API server and the webhook service to ensure that only authenticated endpoints can communicate. #### T02: Webhook DOS Currently, ESO generates an X.509 certificate for webhook registration without authenticating the kube-apiserver. Consequently, if an attacker gains network access to the webhook Pod, they can overload the webhook server and initiate a DoS attack. As a result, modifications to ESO resources may fail, and the ESO core controller may be impacted due to the unavailability of the conversion webhook. #### T03: Unauthorized access to cluster secrets An attacker can | https://github.com/external-secrets/external-secrets/blob/main//docs/guides/threat-model.md | main | external-secrets | [
-0.07939690351486206,
0.03923686221241951,
-0.025603897869586945,
-0.016101937741041183,
0.046685248613357544,
-0.031649038195610046,
0.04017738997936249,
-0.006105168256908655,
0.106244295835495,
0.020488157868385315,
0.01301577128469944,
-0.050495974719524384,
0.022176316007971764,
-0.08... | 0.261819 |
to the webhook Pod, they can overload the webhook server and initiate a DoS attack. As a result, modifications to ESO resources may fail, and the ESO core controller may be impacted due to the unavailability of the conversion webhook. #### T03: Unauthorized access to cluster secrets An attacker can gain unauthorized access to secrets by utilizing the service account token of the ESO core controller Pod or exploiting software vulnerabilities. This unauthorized access allows the attacker to read secrets within the cluster, potentially leading to a cluster takeover. #### T04: unauthorized access to secret provider credentials An attacker can gain unauthorized access to credentials that provide access to external APIs storing secrets. If the credentials have overly broad permissions, this could result in an organization takeover. #### T05: data exfiltration through malicious resources An attacker can exfiltrate data from the cluster by utilizing maliciously crafted resources. Multiple attack vectors can be employed, e.g.: 1. copying data from a namespace to an unauthorized namespace 2. exfiltrating data to an unauthorized secret provider 3. exfiltrating data through an authorized secret provider to a malicious provider account Successful data exfiltration can lead to intellectual property loss, information misuse, loss of customer trust, and damage to the brand or reputation. #### T06: supply chain attacks An attack can infiltrate the ESO container through various attack vectors. The following are some potential entry points, although this is not an exhaustive list. For a comprehensive analysis, refer to [SLSA Threats and mitigations](https://slsa.dev/spec/v0.1/threats) or [GCP software supply chain threats](https://cloud.google.com/software-supply-chain-security/docs/attack-vectors). 1. Source Threats: Unauthorized changes or inclusion of vulnerable code in ESO through code submissions. 2. Build Threats: Creation and distribution of malicious builds of ESO, such as in container registries, Artifact Hub, or Operator Hub. 3. Dependency Threats: Introduction of vulnerable code into ESO dependencies. 4. Deployment and Runtime Threats: Injection of malicious code through compromised deployment processes. #### T07: malicious workloads in eso namespace An attacker can deploy malicious workloads within the external-secrets namespace, taking advantage of the ESO service account with potentially cluster-wide privileges. ### Controls #### C01: Network Security Policy Implement a NetworkPolicy to restrict traffic in both inbound and outbound directions on all networks. Employ a "deny all" / "permit by exception" approach for inbound and outbound network traffic. The specific network policies for the core-controller depend on the chosen provider. The webhook and cert-controller have well-defined sets of endpoints they communicate with. Refer to the [Security Best Practices](./security-best-practices.md) documentation for inbound and outbound network requirements. Please note that ESO does not provide pre-packaged network policies, and it is the user's responsibility to implement the necessary security controls. #### C02: Least Privilege RBAC Adhere to the principle of least privilege by configuring Role-Based Access Control (RBAC) permissions not only for the ESO workload but also for all users interacting with it. Ensure that RBAC permissions on provider side are appropriate according to your setup, by for example limiting which sensitive information a given credential can have access to. Ensure that kubernetes RBAC are set up to grant access to ESO resources only where necessary. For example, allowing write access to `ClusterSecretStore`/`ExternalSecret` may be sufficient for a threat to become a reality. #### C03: Policy Enforcement Implement a Policy Engine such as Kyverno or OPA to enforce restrictions on changes to ESO resources. The specific policies to be enforced depend on the environment. Here are a few suggestions: 1. (Cluster)SecretStore: Restrict the allowed secret providers, disallowing unused or undesired providers (e.g. Webhook). 2. (Cluster)SecretStore: Restrict the permitted authentication mechanisms (e.g. prevent usage of `secretRef`). 3. (Cluster)SecretStore: Enforce limitations on modifications to provider-specific fields | https://github.com/external-secrets/external-secrets/blob/main//docs/guides/threat-model.md | main | external-secrets | [
-0.05408652126789093,
0.0593632347881794,
-0.0227653905749321,
-0.005508530419319868,
0.06207214295864105,
-0.06943707168102264,
0.021034767851233482,
0.017744433134794235,
0.044501569122076035,
0.05994637683033943,
0.010445131920278072,
-0.040510956197977066,
0.04049637168645859,
-0.09098... | 0.281414 |
The specific policies to be enforced depend on the environment. Here are a few suggestions: 1. (Cluster)SecretStore: Restrict the allowed secret providers, disallowing unused or undesired providers (e.g. Webhook). 2. (Cluster)SecretStore: Restrict the permitted authentication mechanisms (e.g. prevent usage of `secretRef`). 3. (Cluster)SecretStore: Enforce limitations on modifications to provider-specific fields relevant for security, such as `caBundle`, `caProvider`, `region`, `role`, `url`, `environmentType`, `identityId`, and `others`. 4. ClusterSecretStore: Control the usage of `namespaceSelector`, such as forbidding or mandating the usage of the `kube-system` namespace. 5. ClusterExternalSecret: Restrict the usage of `namespaceSelector`. Please note that ESO does not provide pre-packaged policies, and it is the user's responsibility to implement the necessary security controls. #### C04: Provider Access Policy Configure fine-grained access control on the HTTP endpoint of the secret provider to prevent data exfiltration across accounts or organizations. Consult the documentation of your specific provider (e.g.: [AWS Secrets Manager VPC Endpoint Policies](https://docs.aws.amazon.com/secretsmanager/latest/userguide/vpc-endpoint-overview.html), [GCP Private Service Connect](https://cloud.google.com/vpc/docs/private-service-connect), or [Azure Private Link](https://learn.microsoft.com/en-us/azure/key-vault/general/private-link-service)) for guidance on setting up access policies. #### C05: Entirely disable CRDs You should disable unused CRDs to narrow down your attack surface. Not all users require the use of `PushSecret`, `ClusterSecretStore` or `ClusterExternalSecret` resources. | https://github.com/external-secrets/external-secrets/blob/main//docs/guides/threat-model.md | main | external-secrets | [
-0.03292077034711838,
0.044546645134687424,
-0.01911715604364872,
-0.026857204735279083,
0.03140636906027794,
-0.004128616768866777,
-0.00822052638977766,
-0.036217864602804184,
-0.022863587364554405,
0.04443927854299545,
0.0007836852455511689,
-0.08044620603322983,
0.009168602526187897,
-... | 0.205128 |
# All Keys, One Secret To get multiple key-values from an external secret, not having to worry about how many, or what these keys are, we have to use the dataFrom field of the ExternalSecret resource, instead of the data field. We will give an example here with the gcp provider (should work with other providers in the same way). Please follow the authentication and SecretStore steps of the [Google Cloud Secrets Manager guide](../provider/google-secrets-manager.md) to setup access to your google cloud account first. Then create a secret in Google Cloud Secret Manager that contains a JSON string with multiple key values like this:  Let's call this secret all-keys-example-secret on Google Cloud. ### Creating dataFrom external secret Now, when creating our ExternalSecret resource, instead of using the data field, we use the dataFrom field: ```yaml {% include 'gcpsm-data-from-external-secret.yaml' %} ``` Here, "example" is the name of the external secret that will be created in our cluster. Whereas, "secret-to-be-created" is the name of Kubernetes secrets that will be created. Note: Since these secrets are namespace-based resources, you can also explicitly specify the "namespace" under the "metadata" block of the above external secret file. when we use, ``` dataFrom: - extract: key: all-keys-example-secret ``` We get all the key-value pairs present over the remote secret store (GCP or AWS or Azure) and can pass either all or a few key-values as environment variables. Please note that, "all-keys-example-secret" is the name of your secret present on GCP/AWS secrets manager/Azure We can pass a few secrets as env variables as below: ``` env: - name: key1 valueFrom: secretKeyRef: name: secret-to-be-created key: username - name: key2 valueFrom: secretKeyRef: name: secret-to-be-created key: surname ``` Here, \ and \ are the names of keys that will be created and passed as env variables. \: is the name of your Kubernetes secret created by you. \ and \: is the particular key in the secrets manager whose value you want to pass. To check both values we can run: ``` kubectl get secret secret-to-be-created -n -o jsonpath='{.data.username}' | base64 -d kubectl get secret secret-to-be-created -n -o jsonpath='{.data.surname}' | base64 -d ``` Also, if you have a large number of secrets and you want to pass all of them as environment variables, then either you can replicate the above steps in your deployment file for all the keys or you can use the envFrom block as below: ``` spec: containers: - command: - mkdir abc.sh envFrom: - secretRef: name: secret-to-be-created ``` | https://github.com/external-secrets/external-secrets/blob/main//docs/guides/all-keys-one-secret.md | main | external-secrets | [
-0.08205829560756683,
-0.008914200589060783,
0.03801571950316429,
0.015121657401323318,
-0.00714585417881608,
-0.01865348592400551,
0.08083992451429367,
0.018000485375523567,
0.03013431839644909,
0.01975097507238388,
0.05767908692359924,
-0.06529819220304489,
0.09690964221954346,
-0.026433... | -0.086017 |
Generators allow you to generate values. They are used through a ExternalSecret `spec.DataFrom`. They are referenced from a custom resource using `sourceRef.generatorRef`. If the External Secret should be refreshed via `spec.refreshInterval` the generator produces a map of values with the `generator.spec` as input. The generator does not keep track of the produced values. Every invocation produces a new set of values. These values can be used with the other features like `rewrite` or `template`. I.e. you can modify, encode, decode, pack the values as needed. ## Reference Custom Resource Generators can be defined as a custom resource and reused across different ExternalSecrets. \*\*Every invocation creates a new set of values\*\*. I.e. you can not share the same value produced by a generator across different `ExternalSecrets` or `spec.dataFrom[]` entries. ```yaml apiVersion: external-secrets.io/v1 kind: ExternalSecret metadata: name: "ecr-token" spec: refreshInterval: "30m0s" target: name: ecr-token dataFrom: - sourceRef: generatorRef: apiVersion: generators.external-secrets.io/v1alpha1 kind: ECRAuthorizationToken name: "my-ecr" ``` ## Cluster Generate Resource It's possible to use a `Cluster` scoped generator. At the moment of this writing, this Generator will only help in locating the Generator cluster-wide. It doesn't mean that the generator can create resources in all namespaces. It will still only create a resource in the given namespace where the referencing `ExternalSecret` lives. To define a `ClusterGenerator` use the following config: ```yaml apiVersion: generators.external-secrets.io/v1alpha1 kind: ClusterGenerator metadata: name: my-generator spec: kind: Password generator: passwordSpec: length: 42 digits: 5 symbols: 5 symbolCharacters: "-\_$@" noUpper: false allowRepeat: true ``` All the generators are available as a ClusterGenerator spec. The `kind` field MUST match the kind of the Generator exactly. The following Spec fields are available: ```go type GeneratorSpec struct { ACRAccessTokenSpec \*ACRAccessTokenSpec `json:"acrAccessTokenSpec,omitempty"` ECRAuthorizationTokenSpec \*ECRAuthorizationTokenSpec `json:"ecrAuthorizationTokenSpec,omitempty"` FakeSpec \*FakeSpec `json:"fakeSpec,omitempty"` GCRAccessTokenSpec \*GCRAccessTokenSpec `json:"gcrAccessTokenSpec,omitempty"` GithubAccessTokenSpec \*GithubAccessTokenSpec `json:"githubAccessTokenSpec,omitempty"` PasswordSpec \*PasswordSpec `json:"passwordSpec,omitempty"` SSHKeySpec \*SSHKeySpec `json:"sshKeySpec,omitempty"` STSSessionTokenSpec \*STSSessionTokenSpec `json:"stsSessionTokenSpec,omitempty"` UUIDSpec \*UUIDSpec `json:"uuidSpec,omitempty"` VaultDynamicSecretSpec \*VaultDynamicSecretSpec `json:"vaultDynamicSecretSpec,omitempty"` WebhookSpec \*WebhookSpec `json:"webhookSpec,omitempty"` } ``` | https://github.com/external-secrets/external-secrets/blob/main//docs/guides/generator.md | main | external-secrets | [
-0.12767261266708374,
0.03861206769943237,
-0.05419516935944557,
0.08529989421367645,
0.0005723165813833475,
-0.039959121495485306,
0.023560067638754845,
-0.013019667007029057,
0.05831443890929222,
-0.012946182861924171,
0.0042348760180175304,
-0.09790930896997452,
0.06840328127145767,
-0.... | 0.069144 |
# Security Best Practices The purpose of this document is to outline a set of best practices for securing the External Secrets Operator (ESO). These practices aim to mitigate the risk of successful attacks against ESO and the Kubernetes cluster it integrates with. ## Security Functions and Features ### 1. Namespace Isolation To maintain security boundaries, ESO ensures that namespaced resources like `SecretStore` and `ExternalSecret` are limited to their respective namespaces. The following rules apply: 1. `ExternalSecret` resources must not have cross-namespace references of `Kind=SecretStore` or `Kind=Secret` resources 2. `SecretStore` resources must not have cross-namespace references of `Kind=Secret` or others For cluster-wide resources like `ClusterSecretStore` and `ClusterExternalSecret`, exercise caution since they have access to Secret resources across all namespaces. Minimize RBAC permissions for administrators and developers to the necessary minimum. If cluster-wide resources are not required, it is recommended to disable them. ### 2. Configure ClusterSecretStore match conditions Utilize the ClusterSecretStore resource to define specific match conditions using `namespaceSelector` or an explicit namespaces list. This restricts the usage of the `ClusterSecretStore` to a predetermined list of namespaces or a namespace that matches a predefined label. Here's an example: ```yaml apiVersion: external-secrets.io/v1 kind: ClusterSecretStore metadata: name: fake spec: conditions: - namespaceSelector: matchLabels: app: frontend ``` ### 3. Selectively Disable Reconciliation of Resources ESO allows you to selectively disable the reconciliation of resources. You can disable reconciliation for: - \*\*Cluster-wide resources\*\*: `ClusterSecretStore`, `ClusterExternalSecret` - \*\*Namespaced resources\*\*: `SecretStore`, `PushSecret` You can disable the installation of CRDs and reconciliation in the Helm chart, or disable reconciliation in the core controller. To disable reconciliation in the Helm chart: ```yaml processClusterExternalSecret: false processClusterStore: false processPushSecret: false processSecretStore: false ``` To disable CRD installation in the Helm chart: ```yaml crds: createClusterExternalSecret: false createClusterSecretStore: false createSecretStore: false createPushSecret: false ``` \*\*Warning:\*\* Disabling the `SecretStore` CRD will prevent ExternalSecrets from referencing namespaced SecretStores. Only use this if you exclusively use ClusterSecretStore. Note that disabling CRD installation for a resource does not automatically disable its reconciliation. The core controller will issue error logs if the CRD is not installed but the reconciliation is not disabled. To disable reconciliation in the core controller, set the following flags: ``` --enable-cluster-external-secret-reconciler=false --enable-cluster-store-reconciler=false --enable-secret-store-reconciler=false --enable-push-secret-reconciler=false ``` ### 4. Implement Namespace-Scoped Installation To further enhance security, consider installing ESO into a specific namespace with restricted access to only that namespace's resources. This prevents access to cluster-wide secrets. Use the following Helm values to scope the controller to a specific namespace: ```yaml # If set to true, create scoped RBAC roles under the scoped namespace # and implicitly disable cluster stores and cluster external secrets scopedRBAC: true # Specify the namespace where external secrets should be reconciled scopedNamespace: my-namespace ``` ### 5. Restrict Webhook TLS Ciphers Consider installing ESO restricting webhook ciphers. Use the following Helm values to scope webhook for specific TLS ciphers: ```yaml webhook: extraArgs: tls-ciphers: "TLS\_ECDHE\_ECDSA\_WITH\_CHACHA20\_POLY1305\_SHA256,TLS\_ECDHE\_RSA\_WITH\_CHACHA20\_POLY1305\_SHA256" ``` ### 6. Harden the Helm Chart The provided Helm chart is designed for ease of use and may not meet your organization's specific security requirements out-of-the-box. It is crucial to review the default Helm chart values and harden the configuration. Any misconfiguration caused by using the provided helm charts is not covered by our support policy - even if it leads to a security incident. Here are some examples of how you can harden the Helm chart: \* \*\*Scope RBAC Permissions\*\*: The default chart grants permissions to create service account tokens for any service account. You can restrict this by modifying the `ClusterRole` to only allow token creation for specific, known service accounts. This limits the operator's ability to impersonate other service accounts. \* \*\*Use Tightly | https://github.com/external-secrets/external-secrets/blob/main//docs/guides/security-best-practices.md | main | external-secrets | [
-0.06415113061666489,
-0.02929798699915409,
-0.04131433367729187,
0.02066008746623993,
0.019405649974942207,
-0.0004985828418284655,
0.04360244795680046,
0.006987522356212139,
0.030993565917015076,
0.0030112331733107567,
0.006801857613027096,
-0.058644071221351624,
0.0371038056910038,
-0.0... | 0.218893 |
chart: \* \*\*Scope RBAC Permissions\*\*: The default chart grants permissions to create service account tokens for any service account. You can restrict this by modifying the `ClusterRole` to only allow token creation for specific, known service accounts. This limits the operator's ability to impersonate other service accounts. \* \*\*Use Tightly Scoped Deployments\*\*: If you don't need certain features, disable them. For example, you can prevent the injection of sidecar containers by using a custom appArmor profile, or an admission controller like Kyverno to enforce restrictions on your deployment. \* \*\*Use it as a Dependency\*\*: Instead of deploying the chart directly, you can use it as a dependency in your own Helm chart. This allows you to extend its functionality and layer on your own security controls, such as `NetworkPolicies`, custom `RBAC` roles, and other security mechanisms that are specific to your environment. ## Pod Security The Pods of the External Secrets Operator have been configured to meet the [Pod Security Standards](https://kubernetes.io/docs/concepts/security/pod-security-standards/), specifically the restricted profile. This configuration ensures a strong security posture by implementing recommended best practices for hardening Pods, including those outlined in the [NSA Kubernetes Hardening Guide](https://media.defense.gov/2022/Aug/29/2003066362/-1/-1/0/CTR\_KUBERNETES\_HARDENING\_GUIDANCE\_1.2\_20220829.PDF). By adhering to these standards, the External Secrets Operator benefits from a secure and resilient operating environment. The restricted profile has been set as the default configuration since version `v0.8.2`, and it is recommended to maintain this setting to align with the principle of least privilege. ## Role-Based Access Control (RBAC) The External Secrets Operator operates with elevated privileges within your Kubernetes cluster, allowing it to read and write to all secrets across all namespaces. It is crucial to properly restrict access to ESO resources such as `ExternalSecret` and `SecretStore` where necessary. This is particularly important for cluster-scoped resources like `ClusterExternalSecret` and `ClusterSecretStore`. Unauthorized tampering with these resources by an attacker could lead to unauthorized access to secrets or potential data exfiltration from your system. In most scenarios, the External Secrets Operator is deployed cluster-wide. However, if you prefer to run it on a per-namespace basis, you can scope it to a specific namespace using the `scopedRBAC` and `scopedNamespace` options in the helm chart. To ensure a secure RBAC configuration, consider the following checklist: \* Restrict access to execute shell commands (pods/exec) within the External Secrets Operator Pod. \* Restrict access to (Cluster)ExternalSecret and (Cluster)SecretStore resources. \* Limit access to aggregated ClusterRoles (view/edit/admin) as needed. \* If necessary, deploy ESO with scoped RBAC or within a specific namespace. By carefully managing RBAC permissions and scoping the External Secrets Operator appropriately, you can enhance the security of your Kubernetes cluster. ## Network Traffic and Security To ensure a secure network environment, it is recommended to restrict network traffic to and from the External Secrets Operator using `NetworkPolicies` or similar mechanisms. By default, the External Secrets Operator does not include pre-defined Network Policies. To implement network restrictions effectively, consider the following steps: \* Define and apply appropriate NetworkPolicies to limit inbound and outbound traffic for the External Secrets Operator. \* Specify a "deny all" policy by default and selectively permit necessary communication based on your specific requirements. \* Restrict access to only the required endpoints and protocols for the External Secrets Operator, such as communication with the Kubernetes API server or external secret providers. \* Regularly review and update the Network Policies to align with changes in your network infrastructure and security requirements. It is the responsibility of the user to define and configure Network Policies tailored to their specific environment and security needs. By implementing proper network restrictions, you can enhance the overall security posture of the External Secrets Operator within your | https://github.com/external-secrets/external-secrets/blob/main//docs/guides/security-best-practices.md | main | external-secrets | [
-0.0031196349300444126,
0.03355879709124565,
-0.02601366676390171,
-0.02743404731154442,
-0.006963450461626053,
0.036407217383384705,
0.03170398622751236,
0.010816005989909172,
-0.014417765662074089,
0.043427444994449615,
0.033867232501506805,
-0.046051740646362305,
0.05603819712996483,
0.... | 0.163144 |
align with changes in your network infrastructure and security requirements. It is the responsibility of the user to define and configure Network Policies tailored to their specific environment and security needs. By implementing proper network restrictions, you can enhance the overall security posture of the External Secrets Operator within your Kubernetes cluster. !!! danger "Data Exfiltration Risk" If not configured properly ESO may be used to exfiltrate data out of your cluster. It is advised to create tight NetworkPolicies and use a policy engine such as kyverno to prevent data exfiltration. ### Outbound Traffic Restrictions #### Core Controller Restrict outbound traffic from the core controller component to the following destinations: \* `kube-apiserver`: The Kubernetes API server. \* Secret provider (e.g., AWS, GCP): Whenever possible, use private endpoints to establish secure and private communication. #### Webhook \* Restrict outbound traffic from the webhook component to the `kube-apiserver`. #### Cert Controller \* Restrict outbound traffic from the cert controller component to the `kube-apiserver`. ### Inbound Traffic Restrictions #### Core Controller \* Restrict inbound traffic to the core controller component by allowing communication on port `8080` from your monitoring agent. #### Cert Controller \* Restrict inbound traffic to the cert controller component by allowing communication on port `8080` from your monitoring agent. \* Additionally, permit inbound traffic on port `8081` from the kubelet for health check endpoints (healthz/readyz). #### Webhook Restrict inbound traffic to the webhook component as follows: \* Allow communication on port `10250` from the kube-apiserver. \* Allow communication on port `8080` from your monitoring agent. \* Permit inbound traffic on port `8081` from the kubelet for health check endpoints (healthz/readyz). ## Policy Engine Best Practices To enhance the security and enforce specific policies for External Secrets Operator (ESO) resources such as SecretStore and ExternalSecret, it is recommended to utilize a policy engine like [Kyverno](http://kyverno.io/) or [OPA Gatekeeper](https://github.com/open-policy-agent/gatekeeper). These policy engines provide a way to define and enforce custom policies that restrict changes made to ESO resources. !!! danger "Data Exfiltration Risk" ESO could be used to exfiltrate data out of your cluster. You should disable all providers you don't need. Further, you should implement `NetworkPolicies` to restrict network access to known entities (see above), to prevent data exfiltration. Here are some recommendations to consider when configuring your policies: 1. \*\*Explicitly Deny Unused Providers\*\*: Create policies that explicitly deny the usage of secret providers that are not required in your environment. This prevents unauthorized access to unnecessary providers and reduces the attack surface. 2. \*\*Restrict Access to Secrets\*\*: Implement policies that restrict access to secrets based on specific conditions. For example, you can define policies to allow access to secrets only if they have a particular prefix in the `.spec.data[].remoteRef.key` field. This helps ensure that only authorized entities can access sensitive information. 3. \*\*Restrict `ClusterSecretStore` References\*\*: Define policies to restrict the usage of ClusterSecretStore references within ExternalSecret resources. This ensures that the resources are properly scoped and prevent potential unauthorized access to secrets across namespaces. By leveraging a policy engine, you can implement these recommendations and enforce custom policies that align with your organization's security requirements. Please refer to the documentation of the chosen policy engine (e.g., Kyverno or OPA Gatekeeper) for detailed instructions on how to define and enforce policies for ESO resources. !!! note "Provider Validation Example Policy" The following policy validates the usage of the `provider` field in the SecretStore manifest. ```yaml {% filter indent(width=4) %} {% include 'kyverno-policy-secretstore.yaml' %} {% endfilter %} ``` ## Regular Patches To maintain a secure environment, it is crucial to regularly patch and update all software components of External Secrets Operator and | https://github.com/external-secrets/external-secrets/blob/main//docs/guides/security-best-practices.md | main | external-secrets | [
0.0025879524182528257,
0.048806287348270416,
0.009743132628500462,
-0.020731188356876373,
-0.02687777206301689,
0.015565209090709686,
0.00043891099630855024,
0.003945521079003811,
0.059530116617679596,
0.05175177752971649,
-0.01389328483492136,
-0.08065427839756012,
0.02927004173398018,
-0... | 0.151234 |
following policy validates the usage of the `provider` field in the SecretStore manifest. ```yaml {% filter indent(width=4) %} {% include 'kyverno-policy-secretstore.yaml' %} {% endfilter %} ``` ## Regular Patches To maintain a secure environment, it is crucial to regularly patch and update all software components of External Secrets Operator and the underlying cluster. By doing so, known vulnerabilities can be addressed, and the overall system's security can be improved. Here are some recommended practices for ensuring timely updates: 1. \*\*Automated Patching and Updating\*\*: Utilize automated patching and updating tools to streamline the process of keeping software components up-to-date 2. \*\*Regular Update ESO\*\*: Stay informed about the latest updates and releases provided for ESO. The development team regularly releases updates to improve stability, performance, and security. Please refer to the [Stability and Support](../introduction/stability-support.md) documentation for more information on the available updates 3. \*\*Cluster-wide Updates\*\*: Apart from ESO, ensure that all other software components within your cluster, such as the operating system, container runtime, and Kubernetes itself, are regularly patched and updated. By adhering to a regular patching and updating schedule, you can proactively mitigate security risks associated with known vulnerabilities and ensure the overall stability and security of your ESO deployment. ## Verify Artefacts ### Verify Container Images The container images of External Secrets Operator are signed using Cosign and the keyless signing feature. To ensure the authenticity and integrity of the container image, you can follow the steps outlined below: ```sh # Retrieve Image Signature $ crane digest ghcr.io/external-secrets/external-secrets:v0.8.1 sha256:36e606279dbebac51b4b9300b9fa85e8c08c1c673ba3ecc38af1402a0b035554 # verify signature $ COSIGN\_EXPERIMENTAL=1 cosign verify ghcr.io/external-secrets/external-secrets@sha256:36e606279dbebac51b4b9300b9fa85e8c08c1c673ba3ecc38af1402a0b035554 | jq # ... [ { "critical": { "identity": { "docker-reference": "ghcr.io/external-secrets/external-secrets" }, "image": { "docker-manifest-digest": "sha256:36e606279dbebac51b4b9300b9fa85e8c08c1c673ba3ecc38af1402a0b035554" }, "type": "cosign container image signature" }, "optional": { "1.3.6.1.4.1.57264.1.1": "https://token.actions.githubusercontent.com", "1.3.6.1.4.1.57264.1.2": "workflow\_dispatch", "1.3.6.1.4.1.57264.1.3": "a0d2aef2e35c259c9ee75d65f7587e6ed71ef2ad", "1.3.6.1.4.1.57264.1.4": "Create Release", "1.3.6.1.4.1.57264.1.5": "external-secrets/external-secrets", "1.3.6.1.4.1.57264.1.6": "refs/heads/main", "Bundle": { # ... }, "GITHUB\_ACTOR": "gusfcarvalho", "Issuer": "https://token.actions.githubusercontent.com", "Subject": "https://github.com/external-secrets/external-secrets/.github/workflows/release.yml@refs/heads/main", "githubWorkflowName": "Create Release", "githubWorkflowRef": "refs/heads/main", "githubWorkflowRepository": "external-secrets/external-secrets", "githubWorkflowSha": "a0d2aef2e35c259c9ee75d65f7587e6ed71ef2ad", "githubWorkflowTrigger": "workflow\_dispatch" } } ] ``` In the output of the verification process, pay close attention to the `optional.Issuer` and `optional.Subject` fields. These fields contain important information about the image's authenticity. Verify that the values of Issuer and Subject match the expected values for the ESO container image. If they do not match, it indicates that the image is not legitimate and should not be used. By following these steps and confirming that the Issuer and Subject fields align with the expected values for the ESO container image, you can ensure that the image has not been tampered with and is safe to use. ### Verifying Provenance The External Secrets Operator employs the [SLSA](https://slsa.dev/provenance/v0.1) (Supply Chain Levels for Software Artifacts) standard to create and attest to the provenance of its builds. Provenance verification is essential to ensure the integrity and trustworthiness of the software supply chain. This outlines the process of verifying the attested provenance of External Secrets Operator builds using the cosign tool. ```sh $ COSIGN\_EXPERIMENTAL=1 cosign verify-attestation --type slsaprovenance ghcr.io/external-secrets/external-secrets:v0.8.1 | jq .payload -r | base64 --decode | jq Verification for ghcr.io/external-secrets/external-secrets:v0.8.1 -- The following checks were performed on each of these signatures: - The cosign claims were validated - Existence of the claims in the transparency log was verified offline - Any certificates were verified against the Fulcio roots. Certificate subject: https://github.com/external-secrets/external-secrets/.github/workflows/release.yml@refs/heads/main Certificate issuer URL: https://token.actions.githubusercontent.com GitHub Workflow Trigger: workflow\_dispatch GitHub Workflow SHA: a0d2aef2e35c259c9ee75d65f7587e6ed71ef2ad GitHub Workflow Name: Create Release GitHub Workflow Trigger external-secrets/external-secrets GitHub Workflow Ref: refs/heads/main { "\_type": "https://in-toto.io/Statement/v0.1", "predicateType": "https://slsa.dev/provenance/v0.2", "subject": [ { "name": "ghcr.io/external-secrets/external-secrets", "digest": { "sha256": "36e606279dbebac51b4b9300b9fa85e8c08c1c673ba3ecc38af1402a0b035554" } } ], "predicate": { "builder": { "id": "https://github.com/external-secrets/external-secrets/Attestations/GitHubHostedActions@v1" }, "buildType": "https://github.com/Attestations/GitHubActionsWorkflow@v1", "invocation": { "configSource": { "uri": "git+https://github.com/external-secrets/external-secrets", "digest": | https://github.com/external-secrets/external-secrets/blob/main//docs/guides/security-best-practices.md | main | external-secrets | [
-0.05924610793590546,
-0.0036906644236296415,
0.02523808740079403,
-0.039585985243320465,
0.01954251527786255,
-0.02551608718931675,
-0.019179893657565117,
-0.00819464772939682,
-0.057139378041028976,
0.040542423725128174,
0.028059562668204308,
0.027080271393060684,
-0.015693064779043198,
... | 0.158049 |
GitHub Workflow SHA: a0d2aef2e35c259c9ee75d65f7587e6ed71ef2ad GitHub Workflow Name: Create Release GitHub Workflow Trigger external-secrets/external-secrets GitHub Workflow Ref: refs/heads/main { "\_type": "https://in-toto.io/Statement/v0.1", "predicateType": "https://slsa.dev/provenance/v0.2", "subject": [ { "name": "ghcr.io/external-secrets/external-secrets", "digest": { "sha256": "36e606279dbebac51b4b9300b9fa85e8c08c1c673ba3ecc38af1402a0b035554" } } ], "predicate": { "builder": { "id": "https://github.com/external-secrets/external-secrets/Attestations/GitHubHostedActions@v1" }, "buildType": "https://github.com/Attestations/GitHubActionsWorkflow@v1", "invocation": { "configSource": { "uri": "git+https://github.com/external-secrets/external-secrets", "digest": { "sha1": "a0d2aef2e35c259c9ee75d65f7587e6ed71ef2ad" }, "entryPoint": "Create Release" }, "parameters": { "version": "v0.8.1" } }, [...] } } ``` ### Fetching SBOM Every External Secrets Operator image is accompanied by an SBOM (Software Bill of Materials) in SPDX JSON format. The SBOM provides detailed information about the software components and dependencies used in the image. This technical documentation explains the process of downloading and verifying the SBOM for a specific version of External Secrets Operator using the Cosign tool. ```sh $ crane digest ghcr.io/external-secrets/external-secrets:v0.8.1 sha256:36e606279dbebac51b4b9300b9fa85e8c08c1c673ba3ecc38af1402a0b035554 $ COSIGN\_EXPERIMENTAL=1 cosign verify-attestation --type spdx ghcr.io/external-secrets/external-secrets@sha256:36e606279dbebac51b4b9300b9fa85e8c08c1c673ba3ecc38af1402a0b035554 | jq '.payload |= @base64d | .payload | fromjson' | jq '.predicate.Data | fromjson' [...] { "SPDXID": "SPDXRef-DOCUMENT", "name": "ghcr.io/external-secrets/external-secrets@sha256-36e606279dbebac51b4b9300b9fa85e8c08c1c673ba3ecc38af1402a0b035554", "spdxVersion": "SPDX-2.2", "creationInfo": { "created": "2023-03-17T23:17:01.568002344Z", "creators": [ "Organization: Anchore, Inc", "Tool: syft-0.40.1" ], "licenseListVersion": "3.16" }, "dataLicense": "CC0-1.0", "documentNamespace": "https://anchore.com/syft/image/ghcr.io/external-secrets/external-secrets@sha256-36e606279dbebac51b4b9300b9fa85e8c08c1c673ba3ecc38af1402a0b035554-83484ebb-b469-45fa-8fcc-9290c4ea4f6f", "packages": [ [...] { "SPDXID": "SPDXRef-c809070b0beb099e", "name": "tzdata", "licenseConcluded": "NONE", "downloadLocation": "NOASSERTION", "externalRefs": [ { "referenceCategory": "SECURITY", "referenceLocator": "cpe:2.3:a:tzdata:tzdata:2021a-1\\+deb11u8:\*:\*:\*:\*:\*:\*:\*", "referenceType": "cpe23Type" }, { "referenceCategory": "PACKAGE\_MANAGER", "referenceLocator": "pkg:deb/debian/tzdata@2021a-1+deb11u8?arch=all&distro=debian-11", "referenceType": "purl" } ], "filesAnalyzed": false, "licenseDeclared": "NONE", "originator": "Person: GNU Libc Maintainers ", "sourceInfo": "acquired package info from DPKG DB: /var/lib/dpkg/status.d/tzdata, /usr/share/doc/tzdata/copyright", "versionInfo": "2021a-1+deb11u8" } ] } ``` | https://github.com/external-secrets/external-secrets/blob/main//docs/guides/security-best-practices.md | main | external-secrets | [
-0.06501075625419617,
0.008695757016539574,
-0.025677187368273735,
0.011486348696053028,
0.07107241451740265,
-0.05461229383945465,
-0.008580377325415611,
-0.003731258912011981,
0.07927687466144562,
0.026285294443368912,
0.0323069803416729,
-0.08309555798768997,
0.0043799844570457935,
0.02... | 0.106841 |
# Fetching information from multiple secrets In some use cases, it might be impractical to bundle all sensitive information into a single secret, or even it is not possible to fully know a given secret name. In such cases, it is possible that a user might need to sync multiple secrets from an external provider into a single Kubernetes Secret. This is possible to be done in external-secrets with the `dataFrom.find` option. !!! note The secret's contents as defined in the provider are going to be stored in the kubernetes secret as a single key. Currently, it's possible to apply a decoding Strategy during a find operation, but only at the secret level (e.g. if a secret is a JSON with some B64 encoded data within, `decodingStrategy: Auto` would not decode it) ### Fetching secrets matching a given name pattern To fetch multiple secrets matching a name pattern from a common SecretStore you can apply the following manifest: ```yaml {% include 'getallsecrets-find-by-name.yaml' %} ``` Suppose we contain secrets `/path/key1`, `key2/path`, and `path/to/keyring` with their respective values. The above YAML will produce the following kubernetes Secret: ```yaml \_path\_key1: Cg== key2\_path: Cg== path\_to\_keyring: Cg== ``` ### Fetching secrets matching a set of metadata tags To fetch multiple secrets matching a name pattern from a common SecretStore you can apply the following manifest: ```yaml {% include 'getallsecrets-find-by-tags.yaml' %} ``` This will match any secrets containing all of the metadata labels in the `tags` parameter. At least one tag must be provided in order to allow finding secrets by metadata tags. ### Searching only in a given path Some providers support filtering out a find operation only to a given path, instead of the root path. In order to use this feature, you can pass `find.path` to filter out these secrets into only this path, instead of the root path. ### Avoiding name conflicts By default, kubernetes Secrets accepts only a given range of characters. `Find` operations will automatically replace any not allowed character with a `\_`. So if we have a given secret `a\_c` and `a/c` would lead to a naming conflict. If you happen to have a case where a conflict is happening, you can use the `rewrite` block to apply a regexp on one of the find operations (for more information please refer to [Rewriting Keys from DataFrom](datafrom-rewrite.md)). You can also set `dataFrom.find.conversionStrategy: Unicode` to reduce the collision probability. When using `Unicode`, any invalid character will be replaced by its unicode, in the form of `\_UXXXX\_`. In this case, the available kubernetes keys would be `a\_c` and `a\_U2215\_c`, hence avoiding most of possible conflicts. !!! note "PRs welcome" Some providers might not have the implementation needed for fetching multiple secrets. If that's your case, please feel free to contribute! | https://github.com/external-secrets/external-secrets/blob/main//docs/guides/getallsecrets.md | main | external-secrets | [
-0.08251642435789108,
0.025293411687016487,
0.0463060699403286,
0.026189805939793587,
-0.045943692326545715,
-0.02341112121939659,
0.016720077022910118,
-0.047555290162563324,
0.11094679683446884,
0.00587824359536171,
0.012634806334972382,
-0.01582896150648594,
0.053219471126794815,
-0.023... | 0.050642 |
# A few common k8s secret types examples Here we will give some examples of how to work with a few common k8s secret types. We will give this examples here with the gcp provider (should work with other providers in the same way). Please also check the guides on [Advanced Templating](templating.md) to understand the details. Please follow the authentication and SecretStore steps of the [Google Cloud Secrets Manager guide](../provider/google-secrets-manager.md) to setup access to your google cloud account first. ## Dockerconfigjson example First create a secret in Google Cloud Secrets Manager containing your docker config:  Let's call this secret docker-config-example on Google Cloud. Then create a ExternalSecret resource taking advantage of templating to populate the generated secret: ```yaml {% include 'gcpsm-docker-config-externalsecret.yaml' %} ``` For Helm users: since Helm interprets the template above, the ExternalSecret resource can be written this way: ```yaml {% include 'gcpsm-docker-config-helm-externalsecret.yaml' %} ``` For more information, please see [this issue](https://github.com/helm/helm/issues/2798) This will generate a valid dockerconfigjson secret for you to use! You can get the final value with: ```bash kubectl get secret secret-to-be-created -n -o jsonpath="{.data.\.dockerconfigjson}" | base64 -d ``` Alternately, if you only have the container registry name and password value, you can take advantage of the advanced ExternalSecret templating functions to create the secret: ```yaml {% raw %} apiVersion: external-secrets.io/v1 kind: ExternalSecret metadata: name: dk-cfg-example spec: refreshInterval: 1h0m0s secretStoreRef: name: example kind: SecretStore target: template: type: kubernetes.io/dockerconfigjson data: .dockerconfigjson: '{"auths":{"{{ .registryName | lower }}.{{ .registryHost }}":{"username":"{{ .registryName }}","password":"{{ .password }}","auth":"{{ printf "%s:%s" .registryName .password | b64enc }}"}}}' data: - secretKey: registryName remoteRef: key: secret/docker-registry-name # "myRegistry" - secretKey: registryHost remoteRef: key: secret/docker-registry-host # "docker.io" - secretKey: password remoteRef: key: secret/docker-registry-password {% endraw %} ``` ## TLS Cert example We are assuming here that you already have valid certificates, maybe generated with letsencrypt or any other CA. So to simplify you can use openssl to generate a single secret pkcs12 cert based on your cert.pem and privkey.pen files. ```bash openssl pkcs12 -export -out certificate.p12 -inkey privkey.pem -in cert.pem ``` With a certificate.p12 you can upload it to Google Cloud Secrets Manager:  And now you can create an ExternalSecret that gets it. You will end up with a k8s secret of type tls with pem values. ```yaml {% include 'gcpsm-tls-externalsecret.yaml' %} ``` You can get their values with: ```bash kubectl get secret secret-to-be-created -n -o jsonpath="{.data.tls\.crt}" | base64 -d kubectl get secret secret-to-be-created -n -o jsonpath="{.data.tls\.key}" | base64 -d ``` ## SSH Auth example Add the ssh privkey to a new Google Cloud Secrets Manager secret:  And now you can create an ExternalSecret that gets it. You will end up with a k8s secret of type ssh-auth with the privatekey value. ```yaml {% include 'gcpsm-ssh-auth-externalsecret.yaml' %} ``` You can get the privkey value with: ```bash kubectl get secret secret-to-be-created -n -o jsonpath="{.data.ssh-privatekey}" | base64 -d ``` ## More examples !!! note "We need more examples here" Feel free to contribute with our docs and add more examples here! | https://github.com/external-secrets/external-secrets/blob/main//docs/guides/common-k8s-secret-types.md | main | external-secrets | [
-0.0987536758184433,
0.05172717571258545,
0.07325775921344757,
-0.014285164885222912,
-0.03629830852150917,
0.02662549540400505,
0.05219968408346176,
0.01630488783121109,
-0.015369267202913761,
0.04920567199587822,
-0.020886771380901337,
-0.09488516300916672,
0.04372015967965126,
-0.022184... | -0.042859 |
External Secrets Operator provides different modes of operation to fulfill organizational needs. This guide outlines the flexibility of ESO and should give you a first impression of how you can employ this operator in your organization. For a multi-tenant deployment you should first examine your organizational structure: 1. what roles (i.e. \*Application Developers\*, \*Cluster Admins\*, ...) do you have in your organization, 2. what responsibilities do they have and 3. how does that map to Kubernetes RBAC roles. Further, you should examine how your external API provider manages access control for your secrets. Can you limit access by secret names (e.g. `db/dev/\*`)? Or only on a bucket level? Please keep in mind that not all external APIs provide fine-grained access management for secrets. \*\*Note:\*\* The following examples should \*\*not\*\* be considered as best practice but rather as a example to show how to combine different mechanics and techniques for tenant isolation. ### Shared ClusterSecretStore  A Cluster Administrator deploys a `ClusterSecretStore` (CSS) and manages access to the external API. The CSS is shared by all tenants within the cluster. Application Developers do reference it in a `ExternalSecret` but can not create a ClusterSecretStores or SecretStores on their own. Now all application developers have access to all the secrets. You probably want to limit access to certain keys or prefixes that should be used. ESO does not provide a mechanic to limit access to certain keys per namespace. More advanced validation should be done with an Admission Webhook, e.g. with [Kyverno](https://kyverno.io/) or [Open Policy Agent](https://www.openpolicyagent.org/)). This setup suites well if you have one central bucket that contains all of your secrets and your Cluster Administrators should manage access to it. This setup is very simple but does not scale very well. ### Managed SecretStore per Namespace  Cluster Administrators manage one or multiple `SecretStores` per Namespace. Each SecretStore uses it's own \*role\* that limits access to a small set of keys. The peculiarity of this is approach is, that \*\*access is actually managed by the external API\*\* which provides the roles. The Cluster Administrator does just the wiring. This approach may be desirable if you have an external entity - let's call it \*\*Secret Administrator\*\* - that manages access and lifecycle of the secrets. ### ESO as a Service  Every namespace is self-contained. Application developers manage `SecretStore`, `ExternalSecret` and secret infrastructure on their own. Cluster Administrators \*just\* provide the External Secrets Operator as a service. This makes sense if application developers should be completely autonomous while a central team provides common services. | https://github.com/external-secrets/external-secrets/blob/main//docs/guides/multi-tenancy.md | main | external-secrets | [
-0.015743067488074303,
-0.027930613607168198,
-0.010584323666989803,
-0.007584545761346817,
-0.053584024310112,
-0.024380797520279884,
0.023125674575567245,
-0.025270698592066765,
0.05975163355469704,
0.017843279987573624,
-0.01218346506357193,
-0.06576001644134521,
0.05546566843986511,
-0... | 0.136325 |
Contrary to what `ExternalSecret` does by pulling secrets from secret providers and creating `kind=Secret` in your cluster, `PushSecret` reads a local `kind=Secret` and pushes its content to a secret provider. The update behavior of `PushSecret` is controlled by `spec.updatePolicy`. The default policy is `Replace`, such that secrets are overwritten in the provider, regardless of whether there already is a secret present in the provider at the given location. If you do not want `PushSecret` to overwrite existing secrets in the provider, you can set `spec.UpdatePolicy` to `IfNotExists`. With this policy, the provider becomes the source of truth. Please note that with using `spec.updatePolicy=IfNotExists` it is possible that the secret value referenced by the `PushSecret` within the cluster differs from the secret value at the given location in the provider. By default, the secret created in the secret provided will not be deleted even after deleting the `PushSecret`, unless you set `spec.deletionPolicy` to `Delete`. ``` yaml {% include 'full-pushsecret.yaml' %} ``` ## Backup use case An interesting use case for `kind=PushSecret` is backing up your current secret from one provider to another one. Imagine you have your secrets in GCP and you want to back them up in Azure Key Vault. You would then create a `SecretStore` for each provider, and an `ExternalSecret` to pull the secrets from GCP. This will generate a `kind=Secret` in your cluster that you can use as the source of a `PushSecret` configured with the Azure `SecretStore`.  ## Pushing the whole secret There are two ways to push an entire secret without defining all keys individually. ### 1. By leaving off the secret key and remote property options. ```yaml {% include 'full-pushsecret-no-key-no-property.yaml' %} ``` This will result in all keys being pushed as they are into the remote location. ### 2. By leaving off the secret key but setting the remote property option. ```yaml {% include 'full-pushsecret-no-key-with-property.yaml' %} ``` This will \_marshal\_ the entire secret data and push it into this single property as a JSON object. !!! warning This should \_ONLY\_ be done if the secret data is marshal-able. Values like, binary data cannot be marshaled and will result in error or invalid secret data. #### Key conversion strategy You can also set `data[\*].conversionStrategy: ReverseUnicode` to reverse the invalid character replaced by the `conversionStrategy: Unicode` configuration in the `ExternalSecret` object as [documented here](../guides/getallsecrets.md#avoiding-name-conflicts). ## Rotate Secrets You can use ESO to rotate secrets by using the PushSecret and Generator resources. ESO will consult the `Kind=Generator` to generate a new secret and then ESO will store it. Every `spec.refreshInterval` the secret will be rotated and the value will be replaced in the store unless `spec.updatePolicy=IfNotExist` is set. Then ESO will generate the secret once and won't rotate it. ```yaml {% include 'pushsecret-generator-rotation-example.yaml' %} ``` | https://github.com/external-secrets/external-secrets/blob/main//docs/guides/pushsecrets.md | main | external-secrets | [
-0.0937834158539772,
-0.04664010554552078,
0.013233327306807041,
0.050961971282958984,
0.018891775980591774,
-0.03524467349052429,
0.04044267162680626,
0.005663218442350626,
0.026661165058612823,
0.021625038236379623,
0.06087304651737213,
-0.029401656240224838,
0.021966900676488876,
-0.035... | 0.017562 |
# Guides The following guides demonstrate use-cases and provide examples of how to use the API. Please pick one of the following guides: \* [Multi-Tenancy Design Considerations](multi-tenancy.md) \* [Find multiple secrets & Extract Secret values](getallsecrets.md) \* [Advanced Templating](templating.md) \* [Targeting Custom Resources](targeting-custom-resources.md) \* [Generating Passwords using generators](generator.md) \* [Ownership and Deletion Policy](ownership-deletion-policy.md) \* [Key Rewriting](datafrom-rewrite.md) \* [Controller Class](controller-class.md) \* [Decoding Strategy](decoding-strategy.md) \* [v1beta1 Migration](v1beta1.md) \* [Deploying image from main](using-latest-image.md) \* [Deploying without cluster features](disable-cluster-features.md) | https://github.com/external-secrets/external-secrets/blob/main//docs/guides/introduction.md | main | external-secrets | [
-0.00009131057595368475,
0.033954281359910965,
-0.08692086488008499,
-0.04766193777322769,
0.025578292086720467,
-0.04180567339062691,
-0.04430156573653221,
0.01737564615905285,
-0.018193909898400307,
0.06366671621799469,
0.03388887271285057,
0.0027469350025057793,
0.13164153695106506,
-0.... | 0.001716 |
# Advanced Templating v1 !!! warning Templating Engine v1 is \*\*deprecated\*\* and will be removed in the future. Please migrate to engine v2 and take a look at our [upgrade guide](templating.md#migrating-from-v1) for changes. !!! note Templating Engine v1 does NOT support templating the `spec.target.template.metadata` fields, or the keys of the `spec.target.template.data` map, it will treat them as plain strings. To use templates in annotations/labels/data-keys, please use Templating Engine v2. With External Secrets Operator you can transform the data from the external secret provider before it is stored as `Kind=Secret`. You can do this with the `Spec.Target.Template`. Each data value is interpreted as a [Go template](https://golang.org/pkg/text/template/). Please note that referencing a non-existing key in the template will raise an error, instead of being suppressed. ## Examples You can use templates to inject your secrets into a configuration file that you mount into your pod: ``` yaml {% include 'multiline-template-v1-external-secret.yaml' %} ``` You can also use pre-defined functions to extract data from your secrets. Here: extract key/cert from a pkcs12 archive and store it as PEM. ``` yaml {% include 'pkcs12-template-v1-external-secret.yaml' %} ``` ### TemplateFrom You do not have to define your templates inline in an ExternalSecret but you can pull `ConfigMaps` or other Secrets that contain a template. Consider the following example: ``` yaml {% include 'template-v1-from-secret.yaml' %} ``` ## Helper functions We provide a bunch of convenience functions that help you transform your secrets. A secret value is a `[]byte`. | Function | Description | Input | Output | | -------------- | -------------------------------------------------------------------------- | -------------------------------- | ------------- | | pkcs12key | extracts the private key from a pkcs12 archive | `[]byte` | `[]byte` | | pkcs12keyPass | extracts the private key from a pkcs12 archive using the provided password | password `string`, data `[]byte` | `[]byte` | | pkcs12cert | extracts the certificate from a pkcs12 archive | `[]byte` | `[]byte` | | pkcs12certPass | extracts the certificate from a pkcs12 archive using the provided password | password `string`, data `[]byte` | `[]byte` | | pemPrivateKey | PEM encodes the provided bytes as private key | `[]byte` | `string` | | pemCertificate | PEM encodes the provided bytes as certificate | `[]byte` | `string` | | jwkPublicKeyPem | takes an json-serialized JWK as `[]byte` and returns an PEM block of type `PUBLIC KEY` that contains the public key ([see here](https://golang.org/pkg/crypto/x509/#MarshalPKIXPublicKey)) for details | `[]byte` | `string` | | jwkPrivateKeyPem | takes an json-serialized JWK as `[]byte` and returns an PEM block of type `PRIVATE KEY` that contains the private key in PKCS #8 format ([see here](https://golang.org/pkg/crypto/x509/#MarshalPKCS8PrivateKey)) for details | `[]byte` | `string` | | base64decode | decodes the provided bytes as base64 | `[]byte` | `[]byte` | | base64encode | encodes the provided bytes as base64 | `[]byte` | `[]byte` | | fromJSON | parses the bytes as JSON so you can access individual properties | `[]byte` | `any` | | toJSON | encodes the provided object as json string | `any` | `string` | | toString | converts bytes to string | `[]byte` | `string` | | toBytes | converts string to bytes | `string` | `[]byte` | | upper | converts all characters to their upper case | `string` | `string` | | lower | converts all character to their lower case | `string` | `string` | | https://github.com/external-secrets/external-secrets/blob/main//docs/guides/templating-v1.md | main | external-secrets | [
-0.05117591470479965,
0.13296222686767578,
-0.02128717303276062,
0.03125239536166191,
0.007541590835899115,
0.028300510719418526,
0.035563986748456955,
0.049981776624917984,
-0.04918743669986725,
-0.06676949560642242,
0.05044948309659958,
-0.06956613063812256,
-0.02067110501229763,
-0.0025... | 0.041336 |
# Upgrading CRD versions From version v0.5.0, `v1alpha1` version is deprecated, and `v1beta1` is in place. This guide will cover the main differences between the two versions, and a procedure on how to safely upgrade it. ## Differences between versions Versions v1alpha1 and v1beta1 are fully-compatible for SecretStores and ClusterSecretStores. For ExternalSecrets, there is a difference on the `dataFrom` method. While in v1alpha1, we could define a `dataFrom` with the following format: ``` spec: dataFrom: - key: my-key - key: my-other-key ``` In v1beta1 is possible to use two methods. One of them is `Extract` and has the exact same behavior as `dataFrom` in v1alpha1. The other is `Find`, which allows finding multiple external secrets and map them into a single Kubernetes secret. Here is an example of `Find`: ``` spec: dataFrom: - find: name: #matches any secret name ending in foo-bar regexp: .\*foo-bar$ - find: tags: #matches any secrets with the following metadata. env: dev app: web ``` ## Upgrading If you already have an installation of ESO using `v1alpha1`, we recommend you to upgrade to `v1beta1`. If you do not use `dataFrom` in your ExternalSecrets, or if you deploy the CRDs using the official Helm charts, the upgrade can be done with no risk of losing data. If you are installing CRDs manually, you will need to deploy the bundle CRD file available at `deploys/crds/bundle.yaml`. This bundle file contains `v1beta1` definition and a conversion webhook configuration. This configuration will ensure that new requests to handle any CRD object will only be valid after the upgrade is successfully complete - so there are no risks of losing data due to an incomplete upgrade. Once the new CRDs are applied, you can proceed to upgrade the controller version. Once the upgrade is finished, at each reconcile, any `ExternalSecret`, `SecretStore`, and `ClusterSecretStore` stored in `v1alpha1` will be automatically converted to `v1beta1`. | https://github.com/external-secrets/external-secrets/blob/main//docs/guides/v1beta1.md | main | external-secrets | [
-0.0961495190858841,
0.004387669265270233,
0.03303522989153862,
-0.00831935741007328,
0.04582257941365242,
-0.010231352411210537,
-0.04281163960695267,
0.008248867467045784,
0.04128387197852135,
0.035465795546770096,
0.05256389454007149,
-0.05802526697516441,
0.022943168878555298,
-0.09388... | 0.053628 |
# Advanced Templating v2 With External Secrets Operator you can transform the data from the external secret provider before it is stored as `Kind=Secret`. You can do this with the `Spec.Target.Template`. Each data value is interpreted as a [Go template](https://golang.org/pkg/text/template/). Please note that referencing a non-existing key in the template will raise an error, instead of being suppressed. !!! note Consider using camelcase when defining \*\*.'spec.data.secretkey'\*\*, example: serviceAccountToken If your secret keys contain \*\*`-` (dashes)\*\*, you will need to reference them using \*\*`index`\*\* Example: \*\*`\{\{ index .data "service-account-token" \}\}`\*\* ## Helm When installing ExternalSecrets via `helm`, the template must be escaped so that `helm` will not try to render it. The most straightforward way to accomplish this would be to use backticks ([raw string constants](https://pkg.go.dev/text/template#hdr-Examples)): ```yaml {% include 'helm-template-v2-escape-sequence.yaml' %} ``` ## Examples You can use templates to inject your secrets into a configuration file that you mount into your pod: ```yaml {% include 'multiline-template-v2-external-secret.yaml' %} ``` Another example with two keys in the same secret: ```yaml {% include 'multikey-template-v2-external-secret.yaml' %} ``` ### MergePolicy By default, the templating mechanism will not use any information available from the original `data` and `dataFrom` queries to the provider, and only keep the templated information. It is possible to change this behavior through the use of the `mergePolicy` field. `mergePolicy` currently accepts two values: `Replace` (the default) and `Merge`. When using `Merge`, `data` and `dataFrom` keys will also be embedded into the templated secret, having lower priority than the template outcome. See the example for more information: ```yaml {% include 'merge-template-v2-external-secret.yaml' %} ``` ### TemplateFrom You do not have to define your templates inline in an ExternalSecret but you can pull `ConfigMaps` or other Secrets that contain a template. Consider the following example: ```yaml {% include 'template-v2-from-secret.yaml' %} ``` `TemplateFrom` also gives you the ability to Target your template to the Secret's Annotations, Labels or the Data block. It also allows you to render the templated information as `Values` or as `KeysAndValues` through the `templateAs` configuration: ```yaml {% include 'template-v2-scope-and-target.yaml' %} ``` Lastly, `TemplateFrom` also supports adding `Literal` blocks for quick templating. These `Literal` blocks differ from `Template.Data` as they are rendered as a a `key:value` pair (while the `Template.Data`, you can only template the value). See an example, how to produce a `htpasswd` file that can be used by an ingress-controller (for example: https://kubernetes.github.io/ingress-nginx/examples/auth/basic/) where the contents of the `htpasswd` file needs to be presented via the `auth` key. We use the `htpasswd` function to create a `bcrytped` hash of the password. Suppose you have multiple key-value pairs within your provider secret like ```json { "user1": "password1", "user2": "password2", ... } ``` ```yaml {% include 'template-v2-literal-example.yaml' %} ``` ### Extract Keys and Certificates from PKCS#12 Archive You can use pre-defined functions to extract data from your secrets. Here: extract keys and certificates from a PKCS#12 archive and store it as PEM. ```yaml {% include 'pkcs12-template-v2-external-secret.yaml' %} ``` ### Extract from JWK You can extract the public or private key parts of a JWK and use them as [PKCS#8](https://pkg.go.dev/crypto/x509#ParsePKCS8PrivateKey) private key or PEM-encoded [PKIX](https://pkg.go.dev/crypto/x509#MarshalPKIXPublicKey) public key. A JWK looks similar to this: ```json { "kty": "RSA", "kid": "cc34c0a0-bd5a-4a3c-a50d-a2a7db7643df", "use": "sig", "n": "pjdss...", "e": "AQAB" // ... } ``` And what you want may be a PEM-encoded public or private key portion of it. Take a look at this example on how to transform it into the desired format: ```yaml {% include 'jwk-template-v2-external-secret.yaml' %} ``` ### Filter PEM blocks Consider you have a secret that contains both a certificate and a private key encoded in PEM format and it is your goal to use only | https://github.com/external-secrets/external-secrets/blob/main//docs/guides/templating.md | main | external-secrets | [
-0.04468819499015808,
0.11085355281829834,
-0.0017512253252789378,
0.029823070392012596,
-0.01184196025133133,
0.02340693585574627,
0.052369583398103714,
0.06804549694061279,
0.012817555107176304,
-0.012150873430073261,
0.022198261693120003,
-0.08335881680250168,
0.01846393756568432,
-0.00... | -0.021413 |
a look at this example on how to transform it into the desired format: ```yaml {% include 'jwk-template-v2-external-secret.yaml' %} ``` ### Filter PEM blocks Consider you have a secret that contains both a certificate and a private key encoded in PEM format and it is your goal to use only the certificate from that secret. ``` -----BEGIN PRIVATE KEY----- MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCvxGZOW4IXvGlh . . . m8JCpbJXDfSSVxKHgK1Siw4K6pnTsIA2e/Z+Ha2fvtocERjq7VQMAJFaIZSTKo9Q JwwY+vj0yxWjyzHUzZB33tg= -----END PRIVATE KEY----- -----BEGIN CERTIFICATE----- MIIDMDCCAhigAwIBAgIQabPaXuZCQaCg+eQAVptGGDANBgkqhkiG9w0BAQsFADAV . . . NtFUGA95RGN9s+pl6XY0YARPHf5O76ErC1OZtDTR5RdyQfcM+94gYZsexsXl0aQO 9YD3Wg== -----END CERTIFICATE----- ``` You can achieve that by using the `filterPEM` function to extract a specific type of PEM block from that secret. If multiple blocks of that type (here: `CERTIFICATE`) exist, all of them are returned in the order specified. To extract a specific type of PEM block, pass the type as a string argument to the filterPEM function. Take a look at this example of how to transform a secret which contains a private key and a certificate into the desired format: ```yaml {% include 'filterpem-template-v2-external-secret.yaml' %} ``` In case you have a secret that contains a (partial) certificate chain you can extract the `leaf`, `intermediate` or `root` certificate(s) using the `filterCertChain` function. See the following example on how to use the `filterPEM` and `filterCertChain` functions together to split the certificate chain into a `tls.crt` part only containing the leaf certificate and a `ca.crt` part with all the intermediate certificates. ```yaml {% include 'filtercertchain-template-v2-external-secret.yaml' %} ``` ### RSA Decryption Data From Provider When a provider returns RSA-encrypted values, you can decrypt them directly in the template using the `rsaDecrypt` functions (engine v2). `rsaDecrypt` performs decryption with the private key passed through the pipeline: `" "" >`. `SCHEME` and `HASH` are strings (for example, `"RSA-OAEP"` and `"SHA1"`). The third argument must be the ciphertext in binary form. Base64 handling: providers often return ciphertext as Base64. You can either: - decode in the template with `b64dec` (for example: `(.password\_encrypted\_base64 | b64dec)`), or - set `decodingStrategy: Base64` on the corresponding `spec.data.remoteRef` so the template receives binary data. Prerequisites - `spec.target.template.engineVersion: v2`. - A valid RSA private key in PEM format without passphrase (from another reference in the same ExternalSecret). - Ciphertext must match the key pair and the chosen algorithm/hash. Full example: ```yaml {% include 'rsadecrypt-template-v2-external-secret.yaml' %} ``` Useful variations (included as comments in the example): - Base64 decode in the template with `b64dec` or via `decodingStrategy: Base64` on `spec.data`. - Use a private key available in the same ExternalSecret (for example: `( .private\_key | rsaDecrypt ... )`). Error notes - Referencing a missing key in the template will fail rendering. - If key/algorithm/hash do not match the ciphertext, decryption will fail and reconciliation will retry. ## Templating with PushSecret `PushSecret` templating is much like `ExternalSecrets` templating. In-fact under the hood, it's using the same data structure. Which means, anything described in the above should be possible with push secret as well resulting in a templated secret created at the provider. ```yaml {% include 'template-v2-push-secret.yaml' %} ``` ## Helper functions !!! info inline end Note: we removed `env` and `expandenv` from sprig functions for security reasons. We provide a couple of convenience functions that help you transform your secrets. This is useful when dealing with PKCS#12 archives or JSON Web Keys (JWK). In addition to that you can use over 200+ [sprig functions](http://masterminds.github.io/sprig/). If you feel a function is missing or might be valuable feel free to open an issue and submit a [pull request](../contributing/process.md#submitting-a-pull-request). | Function | Description | | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | pkcs12key | Extracts all private keys from a PKCS#12 archive and encodes them in \*\*PKCS#8 PEM\*\* format. | | | https://github.com/external-secrets/external-secrets/blob/main//docs/guides/templating.md | main | external-secrets | [
-0.038208991289138794,
0.1300753355026245,
0.0157445278018713,
-0.00921020656824112,
0.03682783246040344,
0.005385029595345259,
0.008208569139242172,
0.013146341778337955,
0.03005961887538433,
-0.022127903997898102,
0.015232634730637074,
-0.09905252605676651,
0.04151405021548271,
-0.006640... | -0.114332 |
feel a function is missing or might be valuable feel free to open an issue and submit a [pull request](../contributing/process.md#submitting-a-pull-request). | Function | Description | | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | pkcs12key | Extracts all private keys from a PKCS#12 archive and encodes them in \*\*PKCS#8 PEM\*\* format. | | pkcs12keyPass | Same as `pkcs12key`. Uses the provided password to decrypt the PKCS#12 archive. | | pkcs12cert | Extracts all certificates from a PKCS#12 archive and orders them if possible. If disjunct or multiple leaf certs are provided they are returned as-is. Sort order: `leaf / intermediate(s) / root`. | | pkcs12certPass | Same as `pkcs12cert`. Uses the provided password to decrypt the PKCS#12 archive. | | pemToPkcs12 | Takes a PEM encoded certificate and key and creates a base64 encoded PKCS#12 archive. | | pemToPkcs12Pass | Same as `pemToPkcs12`. Uses the provided password to encrypt the PKCS#12 archive. | | fullPemToPkcs12 | Takes a PEM encoded certificates chain and key and creates a base64 encoded PKCS#12 archive. | | fullPemToPkcs12Pass | Same as `fullPemToPkcs12`. Uses the provided password to encrypt the PKCS#12 archive. | | pemTruststoreToPKCS12 | Takes a PEM encoded certificates and creates a base64 encoded PKCS#12 archive. | | pemTruststoreToPKCS12Pass| Same as `pemTruststoreToPKCS12`. Uses the provided password to encrypt the PKCS#12 archive. | | filterPEM | Filters PEM blocks with a specific type from a list of PEM blocks. | | filterCertChain | Filters PEM block(s) with a specific certificate type (`leaf`, `intermediate` or `root`) from a certificate chain of PEM blocks (PEM blocks with type `CERTIFICATE`). | | jwkPublicKeyPem | Takes an json-serialized JWK and returns an PEM block of type `PUBLIC KEY` that contains the public key. [See here](https://golang.org/pkg/crypto/x509/#MarshalPKIXPublicKey) for details. | | jwkPrivateKeyPem | Takes an json-serialized JWK as `string` and returns an PEM block of type `PRIVATE KEY` that contains the private key in PKCS #8 format. [See here](https://golang.org/pkg/crypto/x509/#MarshalPKCS8PrivateKey) for details. | | rsaDecrypt | Decrypts RSA ciphertext using a PEM private key. Usage: ```` or ````. \*\*SCHEME\*\*: supported values are `"None"` and `"RSA-OAEP"`. \*\*HASH\*\*: supported values are `"SHA1"` and `"SHA256"`. \*\*Ciphertext\*\* must be binary — use `b64dec` or `decodingStrategy: Base64` to convert Base64 payloads. | | toYaml | Takes an interface, marshals it to yaml. It returns a string, even on marshal error (empty string). | | fromYaml | Function converts a YAML document into a map[string]any. | ## Migrating from v1 If you are still using `v1alpha1`, You have to opt-in to use the new engine version by specifying `template.engineVersion=v2`: ```yaml apiVersion: external-secrets.io/v1alpha1 kind: ExternalSecret metadata: name: secret spec: # ... target: template: engineVersion: v2 # ... ``` The biggest change was that basically all function parameter types were changed from accepting/returning `[]byte` to `string`. This is relevant for you because now you don't need to specify `toString` all the time at the end of a template pipeline. ```yaml {% raw %} apiVersion: external-secrets.io/v1alpha1 kind: ExternalSecret # ... spec: target: template: engineVersion: v2 data: # this used to be {{ .foobar | toString }} egg: "new: {{ .foobar }}" {% endraw %} ``` ##### Functions removed/replaced - `base64encode` was renamed to `b64enc`. - `base64decode` was renamed to `b64dec`. Any errors that occur during decoding are silenced. - `fromJSON` was renamed to `fromJson`. Any errors that occur during unmarshalling are silenced. - `toJSON` was renamed to `toJson`. Any errors that occur during marshalling are silenced. - `pkcs12key` and `pkcs12keyPass` encode the PKCS#8 key directly into PEM format. There is no need to call `pemPrivateKey` anymore. Also, these functions do extract all private keys from the PKCS#12 archive not just the first one. | https://github.com/external-secrets/external-secrets/blob/main//docs/guides/templating.md | main | external-secrets | [
-0.09220042079687119,
0.026073133572936058,
0.027912326157093048,
-0.0014610819052904844,
0.04664292559027672,
-0.009589440189301968,
-0.044720057398080826,
0.033961132168769836,
0.03234987333416939,
0.00874327588826418,
-0.013986196368932724,
-0.08545362204313278,
-0.028527643531560898,
-... | 0.028684 |
`toJSON` was renamed to `toJson`. Any errors that occur during marshalling are silenced. - `pkcs12key` and `pkcs12keyPass` encode the PKCS#8 key directly into PEM format. There is no need to call `pemPrivateKey` anymore. Also, these functions do extract all private keys from the PKCS#12 archive not just the first one. - `pkcs12cert` and `pkcs12certPass` encode the certs directly into PEM format. There is no need to call `pemCertificate` anymore. These functions now \*\*extract all certificates\*\* from the PKCS#12 archive not just the first one. - `toString` implementation was replaced by the `sprig` implementation and should be api-compatible. - `toBytes` was removed. - `pemPrivateKey` was removed. It's now implemented within the `pkcs12\*` functions. - `pemCertificate` was removed. It's now implemented within the `pkcs12\*` functions. | https://github.com/external-secrets/external-secrets/blob/main//docs/guides/templating.md | main | external-secrets | [
-0.13729172945022583,
0.07683254778385162,
-0.06798906624317169,
-0.07136261463165283,
0.05934031307697296,
-0.01086523849517107,
-0.036637771874666214,
0.01630522310733795,
0.03506099805235863,
0.005243802443146706,
0.04783761873841286,
0.013790291734039783,
0.030141567811369896,
0.030359... | -0.040164 |
You can test a feature that was not yet released using the following methods, use them at your own discretion: ### Helm 1. Create a `values.yaml` file with the following content: ```yaml replicaCount: 1 image: repository: ghcr.io/external-secrets/external-secrets pullPolicy: IfNotPresent # -- The image tag to use. The default is the chart appVersion. tag: "main" # -- If set, install and upgrade CRDs through helm chart. installCRDs: false ``` 1. Install the crds ```shell make crds.install ``` 1. Install the external-secrets Helm chart indicating the values file created before: ``` helm install external-secrets external-secrets/external-secrets -f values.yaml ``` ### Manual 1. Build the Docker image ```shell docker build -f Dockerfile.standalone -t my-org/external-secrets:latest . ``` 1. Apply the `bundle.yaml` ```shell kubectl apply -f deploy/crds/bundle.yaml --server-side ``` 1. Modify your configs to use the image ```yaml kind: Deployment metadata: name: external-secrets|external-secrets-webhook|external-secrets-cert-controller ... image: my-org/external-secrets:latest ``` | https://github.com/external-secrets/external-secrets/blob/main//docs/guides/using-latest-image.md | main | external-secrets | [
-0.03685936704277992,
0.03472455218434334,
0.050463657826185226,
-0.03630765900015831,
0.048805031925439835,
-0.056963153183460236,
-0.11860793083906174,
0.02718427963554859,
0.034950755536556244,
0.03899887204170227,
0.02535879984498024,
-0.10879666358232498,
0.025560854002833366,
-0.0222... | 0.021945 |
# Using the esoctl tool The tool can be found under `cmd/esoctl`. ## Debugging templates The `template` command can be used to test templates for `PushSecret` and `ExternalSecret`. To run render simply execute `make build` in the `cmd/esoctl` folder. This will result in a binary under `cmd/esoctl/bin`. Once the build succeeds, the command can be used as such: ``` bin/esoctl template --source-templated-object template-test/push-secret.yaml --source-secret-data-file template-test/secret.yaml ``` Where template-test looks like this: ``` ❯ tree template-test/ (base) template-test/ ├── push-secret.yaml └── secret.yaml 1 directory, 2 files ``` `PushSecret` is simply the following: ```yaml {% include 'esoctl-tool-push-secret-snippet.yaml' %} ``` And secret data is: ```yaml token: dG9rZW4= ``` Therefore if there is a PushSecret or an ExternalSecret object that the user would like to test the template for, simply put it into a file along with the data it's using, and run this command. The output will be something like this: ``` bin/esoctl template --source-templated-object template-test/push-secret.yaml --source-secret-data-file template-test/secret.yaml data: token: VE9LRU4gd2FzIHRlbXBsYXRlZA== metadata: creationTimestamp: null echo -n "VE9LRU4gd2FzIHRlbXBsYXRlZA==" | base64 -d TOKEN was templated⏎ ``` Further options can be used to provide templates from a ConfigMap or a Secret: ``` bin/esoctl template --source-templated-object template-test/push-secret.yaml \ --source-secret-data-file template-test/secret.yaml \ --template-from-config-map template-test/template-config-map.yaml \ --template-from-secret template-test/template-secret.yaml ``` ## Bootstrapping generator code The `bootstrap generator` command can be used to create a new generator. When running it, it will automatically: - Bootstrap a new generator CRD - Bootstrap a new generator implementation - Update the register file with the new generator - Update Cluster Generators to include the new generator - Update needed dependencies (go.mod, resolver file, etc) To run, simply execute: ``` bin/esoctl bootstrap generator --name GeneratorName --description "A description of this generator" --package generatorname ``` ### Example ``` bin/esoctl bootstrap generator --name MyAwesomeGenerator --description "An awesome generator I want to add to ESO :)" ✓ Created CRD: /home/gusfcarvalho/Documents/repos/external-secrets/apis/generators/v1alpha1/types\_myawesomegenerator.go ✓ Created implementation: /home/gusfcarvalho/Documents/repos/external-secrets/generators/v1/myawesomegenerator/myawesomegenerator.go ✓ Created test file: /home/gusfcarvalho/Documents/repos/external-secrets/generators/v1/myawesomegenerator/myawesomegenerator\_test.go ✓ Created go.mod: /home/gusfcarvalho/Documents/repos/external-secrets/generators/v1/myawesomegenerator/go.mod ✓ Created go.sum: /home/gusfcarvalho/Documents/repos/external-secrets/generators/v1/myawesomegenerator/go.sum ✓ Updated register file: /home/gusfcarvalho/Documents/repos/external-secrets/pkg/register/generators.go ✓ Updated types\_cluster.go ✓ Updated main go.mod ✓ Updated resolver file: /home/gusfcarvalho/Documents/repos/external-secrets/runtime/esutils/resolvers/generator.go ✓ Updated register.go ✓ Successfully bootstrapped generator: MyAwesomeGenerator Next steps: 1. Review and customize: apis/generators/v1alpha1/types\_myawesomegenerator.go 2. Implement the generator logic in: generators/v1/myawesomegenerator/myawesomegenerator.go 3. Run: go mod tidy 4. Run: make generate 5. Run: make manifests 6. Add tests for your generator ``` You should also expect the following `git diff` with specific changes: ```diff diff --git a/apis/generators/v1alpha1/register.go b/apis/generators/v1alpha1/register.go index 16c05154b..9538bcc57 100644 --- a/apis/generators/v1alpha1/register.go +++ b/apis/generators/v1alpha1/register.go @@ -73,6 +73,9 @@ var ( ClusterGeneratorKind = reflect.TypeOf(ClusterGenerator{}).Name() // CloudsmithAccessTokenKind is the kind name for CloudsmithAccessToken resource. CloudsmithAccessTokenKind = reflect.TypeOf(CloudsmithAccessToken{}).Name() + + // MyAwesomeGeneratorKind is the kind name for MyAwesomeGenerator resource. + MyAwesomeGeneratorKind = reflect.TypeOf(MyAwesomeGenerator{}).Name() ) func init() { @@ -109,4 +112,5 @@ func init() { SchemeBuilder.Register(&Webhook{}, &WebhookList{}) SchemeBuilder.Register(&Grafana{}, &GrafanaList{}) SchemeBuilder.Register(&MFA{}, &MFAList{}) + SchemeBuilder.Register(&MyAwesomeGenerator{}, &MyAwesomeGeneratorList{}) } diff --git a/apis/generators/v1alpha1/types\_cluster.go b/apis/generators/v1alpha1/types\_cluster.go index e212dab76..0245e8f1c 100644 --- a/apis/generators/v1alpha1/types\_cluster.go +++ b/apis/generators/v1alpha1/types\_cluster.go @@ -30,7 +30,7 @@ type ClusterGeneratorSpec struct { } // GeneratorKind represents a kind of generator. -// +kubebuilder:validation:Enum=ACRAccessToken;CloudsmithAccessToken;ECRAuthorizationToken;Fake;GCRAccessToken;GithubAccessToken;QuayAccessToken;Password;SSHKey;STSSessionToken;UUID;VaultDynamicSecret;Webhook;Grafana +// +kubebuilder:validation:Enum=ACRAccessToken;CloudsmithAccessToken;ECRAuthorizationToken;Fake;GCRAccessToken;GithubAccessToken;QuayAccessToken;Password;SSHKey;STSSessionToken;UUID;VaultDynamicSecret;Webhook;Grafana;MyAwesomeGenerator type GeneratorKind string const ( @@ -64,6 +64,8 @@ const ( GeneratorKindMFA GeneratorKind = "MFA" // GeneratorKindCloudsmithAccessToken represents a Cloudsmith access token generator. GeneratorKindCloudsmithAccessToken GeneratorKind = "CloudsmithAccessToken" + // GeneratorKindMyAwesomeGenerator represents a myawesomegenerator generator. + GeneratorKindMyAwesomeGenerator GeneratorKind = "MyAwesomeGenerator" ) // GeneratorSpec defines the configuration for various supported generator types. @@ -85,6 +87,7 @@ type GeneratorSpec struct { WebhookSpec \*WebhookSpec `json:"webhookSpec,omitempty"` GrafanaSpec \*GrafanaSpec `json:"grafanaSpec,omitempty"` MFASpec \*MFASpec `json:"mfaSpec,omitempty"` + MyAwesomeGeneratorSpec \*MyAwesomeGeneratorSpec `json:"myawesomegeneratorSpec,omitempty"` } // ClusterGenerator represents a cluster-wide generator which can be referenced as part of `generatorRef` fields. diff --git a/go.mod b/go.mod index ff95a9558..c73ecb0c7 100644 --- a/go.mod +++ b/go.mod @@ -14,6 +14,7 @@ replace ( github.com/external-secrets/external-secrets/generators/v1/github => ./generators/v1/github github.com/external-secrets/external-secrets/generators/v1/grafana => ./generators/v1/grafana github.com/external-secrets/external-secrets/generators/v1/mfa | https://github.com/external-secrets/external-secrets/blob/main//docs/guides/using-esoctl-tool.md | main | external-secrets | [
-0.11002561450004578,
-0.014819213189184666,
0.005214882083237171,
0.01795327290892601,
0.058521393686532974,
-0.060160212218761444,
-0.043161265552043915,
0.0478096641600132,
0.0052874889224767685,
0.005984734743833542,
0.035555336624383926,
-0.11394529044628143,
-0.024008870124816895,
-0... | 0.039354 |
GrafanaSpec \*GrafanaSpec `json:"grafanaSpec,omitempty"` MFASpec \*MFASpec `json:"mfaSpec,omitempty"` + MyAwesomeGeneratorSpec \*MyAwesomeGeneratorSpec `json:"myawesomegeneratorSpec,omitempty"` } // ClusterGenerator represents a cluster-wide generator which can be referenced as part of `generatorRef` fields. diff --git a/go.mod b/go.mod index ff95a9558..c73ecb0c7 100644 --- a/go.mod +++ b/go.mod @@ -14,6 +14,7 @@ replace ( github.com/external-secrets/external-secrets/generators/v1/github => ./generators/v1/github github.com/external-secrets/external-secrets/generators/v1/grafana => ./generators/v1/grafana github.com/external-secrets/external-secrets/generators/v1/mfa => ./generators/v1/mfa + github.com/external-secrets/external-secrets/generators/v1/myawesomegenerator => ./generators/v1/myawesomegenerator github.com/external-secrets/external-secrets/generators/v1/password => ./generators/v1/password github.com/external-secrets/external-secrets/generators/v1/quay => ./generators/v1/quay github.com/external-secrets/external-secrets/generators/v1/sshkey => ./generators/v1/sshkey diff --git a/pkg/register/generators.go b/pkg/register/generators.go index dd9ad55fb..6aafd4089 100644 --- a/pkg/register/generators.go +++ b/pkg/register/generators.go @@ -34,6 +34,7 @@ import ( uuid "github.com/external-secrets/external-secrets/generators/v1/uuid" vaultgen "github.com/external-secrets/external-secrets/generators/v1/vault" webhookgen "github.com/external-secrets/external-secrets/generators/v1/webhook" + myawesomegenerator "github.com/external-secrets/external-secrets/generators/v1/myawesomegenerator" ) func init() { @@ -53,4 +54,5 @@ func init() { genv1alpha1.Register(uuid.Kind(), uuid.NewGenerator()) genv1alpha1.Register(vaultgen.Kind(), vaultgen.NewGenerator()) genv1alpha1.Register(webhookgen.Kind(), webhookgen.NewGenerator()) + genv1alpha1.Register(myawesomegenerator.Kind(), myawesomegenerator.NewGenerator()) } diff --git a/runtime/esutils/resolvers/generator.go b/runtime/esutils/resolvers/generator.go index 66f4b4037..938ccd6cd 100644 --- a/runtime/esutils/resolvers/generator.go +++ b/runtime/esutils/resolvers/generator.go @@ -302,6 +302,17 @@ func clusterGeneratorToVirtual(gen \*genv1alpha1.ClusterGenerator) (client.Object }, Spec: \*gen.Spec.Generator.MFASpec, }, nil + case genv1alpha1.GeneratorKindMyAwesomeGenerator: + if gen.Spec.Generator.MyAwesomeGeneratorSpec == nil { + return nil, fmt.Errorf("when kind is %s, MyAwesomeGeneratorSpec must be set", gen.Spec.Kind) + } + return &genv1alpha1.MyAwesomeGenerator{ + TypeMeta: metav1.TypeMeta{ + APIVersion: genv1alpha1.SchemeGroupVersion.String(), + Kind: genv1alpha1.MyAwesomeGeneratorKind, + }, + Spec: \*gen.Spec.Generator.MyAwesomeGeneratorSpec, + }, nil default: return nil, fmt.Errorf("unknown kind %s", gen.Spec.Kind) } ``` ### flags #### name Defines the generator name. Must be `PascalCase`. #### description Defines the generator description (added as a golang comment) #### package (optional) Defines the package name for the generator. Must be `snake\_case`. defaults to lowercase of `name` | https://github.com/external-secrets/external-secrets/blob/main//docs/guides/using-esoctl-tool.md | main | external-secrets | [
-0.16615106165409088,
0.03637252748012543,
-0.08366533368825912,
0.016604870557785034,
0.03148878365755081,
-0.039433322846889496,
-0.03262367099523544,
0.005203960929065943,
-0.009096469730138779,
-0.05895347520709038,
0.086549773812294,
-0.07202927768230438,
-0.017822787165641785,
-0.030... | 0.14147 |
# Targeting Custom Resources !!! warning "Maturity" At the time of this writing (1.11.2025) this feature is in heavy alpha status. Please consider the following documentation with the limitations and guardrails described below. External Secrets Operator can create and manage resources beyond Kubernetes Secrets. When you need to populate ConfigMaps or Custom Resource Definitions with secret data from your external provider, you can use the manifest target feature. !!! warning "Security Consideration" Custom resources are not encrypted at rest by Kubernetes. Only use this feature when you need to populate resources that do not contain sensitive credentials, or when the target resource is encrypted by other means. This feature must be explicitly enabled in your deployment using the `--unsafe-allow-generic-targets` flag. !!! note "Namespaced Resources Only" With this feature you can only target namespaced resources - and resources can only be managed by an ExternalSecret in the same namespace as the resource. !!! note "Performance" Using generic targets or custom resources at the moment of this writing is ~20% slower than handling secrets due to certain missing features yet to be implemented. We recommend not overusing this feature without too many objects until further performance improvement are implemented. ## Basic ConfigMap Example The simplest use case is creating a ConfigMap from external secrets. This is useful when applications expect configuration in ConfigMaps rather than Secrets, or when the data is not sensitive. ```yaml {% include 'manifest-basic-configmap.yaml' %} ``` This creates a ConfigMap named `app-config` with the data populated from your secret provider. ## Custom Resource Definitions You can target any custom resource that exists in your cluster. This example creates an Argo CD Application resource: ```yaml {% include 'manifest-argocd-app.yaml' %} ``` The operator will create or update the Application resource with the data from your external secret provider. ## Templating with Custom Resources Templates work with custom resources just as they do with Secrets. You can use the `template.data` field to create structured configuration: ```yaml {% include 'manifest-templated-configmap.yaml' %} ``` ## Advanced Path Targeting When working with custom resources that have complex structures, you can use `target` to specify where template output should be placed. This is particularly useful for resources with nested specifications. ```yaml {% include 'manifest-advanced-path.yaml' %} ``` The `target` field accepts dot-notation paths like `spec.database` or `spec.logging` to place the rendered template output at specific locations in the resource structure. When `target` is not specified it defaults to `Data` for backward compatibility with Secrets. !!! note "Using `property` when templating `data`" The return of `data:` isn't an object on the template scope. If templated as a `string` it will fail in finding the right key. Therefore, something like this: ```yaml data: - secretKey: url remoteRef: key: slack-alerts/myalert-dev ``` templated as a literal: ```yaml {% raw %} template: engineVersion: v2 templateFrom: - literal: | api\_url: {{ .url }} target: spec.slack {% endraw %} ``` will not work. A property like `property: url` MUST be defined. ## Drift Detection The operator automatically detects and corrects manual changes to managed custom resources. If you modify a ConfigMap or custom resource that is managed by an ExternalSecret, the operator will restore it to the desired state immediately. This is achieved with informers watching the relevant GVK of the Resource. ## Metadata and Labels You can add labels and annotations to your target resources using the template metadata: ```yaml {% include 'manifest-labeled-configmap.yaml' %} ``` The operator automatically adds the `externalsecrets.external-secrets.io/managed: "true"` label to track which resources it manages. ## RBAC Requirements When using custom resource targets, ensure the External Secrets Operator has appropriate RBAC permissions to create and manage those resources. The Helm | https://github.com/external-secrets/external-secrets/blob/main//docs/guides/targeting-custom-resources.md | main | external-secrets | [
-0.01492279302328825,
0.028787866234779358,
0.035351190716028214,
0.00982317328453064,
0.012105297297239304,
0.006830370519310236,
0.08313523977994919,
0.01651371829211712,
0.07243131846189499,
0.022160544991493225,
-0.02686925418674946,
-0.08120685815811157,
0.05984262004494667,
0.0241363... | 0.094883 |
resources using the template metadata: ```yaml {% include 'manifest-labeled-configmap.yaml' %} ``` The operator automatically adds the `externalsecrets.external-secrets.io/managed: "true"` label to track which resources it manages. ## RBAC Requirements When using custom resource targets, ensure the External Secrets Operator has appropriate RBAC permissions to create and manage those resources. The Helm chart provides configuration options to enable these permissions: ```yaml genericTargets: enabled: true resources: - apiGroups: ["config.example.com"] resources: ["appconfigs"] verbs: ["get", "list", "watch", "create", "update", "patch", "delete"] ``` Without these permissions, the operator will not be able to create or update your target resources. | https://github.com/external-secrets/external-secrets/blob/main//docs/guides/targeting-custom-resources.md | main | external-secrets | [
-0.03395914286375046,
-0.02221611887216568,
-0.04626108333468437,
0.022790832445025444,
0.06799434870481491,
-0.019227074459195137,
0.014159864746034145,
0.01046162098646164,
0.019639289006590843,
0.042542532086372375,
0.013049387373030186,
-0.031988296657800674,
0.06363702565431595,
0.028... | 0.092247 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.