senhasegura-dsm.md 3.6 KB

Segura® DevOps Secret Manager (DSM)

External Secrets Operator integrates with Segura® DevOps Secret Manager (DSM) 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.

You will need to create an Kubernetes Secret with desired auth parameters, for example:

{% 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

{% include 'senhasegura-dsm-secretstore.yaml' %}

ClusterSecretStore

{% 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:

URL=https://example.com/api/example
TOKEN=example-token-value

**Secret Identifier: ** db-settings

Secret data:

DB_HOST='db.example'
DB_PORT='5432'
DB_USERNAME='example'
DB_PASSWORD='example'

**Secret Identifier: ** hsm-settings

Secret data:

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)

{% include 'senhasegura-dsm-external-secret-single.yaml' %}

Kubernetes Secret will be create with follow .data.X

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

{% include 'senhasegura-dsm-external-secret-multiple.yaml' %}

Kubernetes Secret will be created with the following .data.X

URL='https://example.com/api/example'
TOKEN='example-token-value'
DB_HOST='db.example'
DB_PORT='5432'
DB_USERNAME='example'
DB_PASSWORD='example'