Vaults Manager

Use dataikuapi.DSSClient.get_vaults_manager() to obtain a vaults manager handle. Vault administration requires DSS administrator privileges.

The manager can create definitions for AWS Secrets Manager, Azure Key Vault, and Google Cloud Secret Manager. Authentication settings are represented by provider-specific configuration objects. For example:

from dataikuapi.secretsmanager import (
    AWSIAMRoleAuthConfig,
    DSSVaultCacheSettings,
)

vaults_manager = client.get_vaults_manager()
vault = vaults_manager.create_aws_secrets_manager_vault(
    id="production-aws-vault",
    region_or_endpoint="eu-west-1",
    auth_config=AWSIAMRoleAuthConfig(
        role_arn="arn:aws:iam::123456789012:role/dss-secrets",
    ),
    allowed_remote_secret_identifier_regex="^dss-production-.*",
    cache_settings=DSSVaultCacheSettings(max_caching_minutes=5),
)

Use dataikuapi.secretsmanager.secretsmanager.DSSSecretsManager.create_vault_secret() to create a DSS secret backed by the configured vault:

secrets_manager = client.get_secrets_manager()
secret = secrets_manager.create_vault_secret(
    identifier="snowflake-password",
    vault_id=vault.id,
    remote_secret_identifier="dss-production-snowflake",
)

Vault handles

class dataikuapi.secretsmanager.vaultsmanager.DSSVaultsManager(client)

Collection-level handle for DSS vault administration operations.

Important

Do not instantiate directly, use dataikuapi.DSSClient.get_vaults_manager() instead

list_vaults()

List vaults visible to the current authentication context.

Returns:

vault handles

Return type:

list of DSSVault

get_vault(vault_id)

Get a handle to a specific vault.

Parameters:

vault_id (str) – identifier of the vault

Returns:

handle to the vault

Return type:

DSSVault

create_aws_secrets_manager_vault(id, region_or_endpoint, auth_config=None, permission_items=None, description=None, allowed_remote_secret_identifier_regex=None, cache_settings=None)

Create a new AWS Secrets Manager vault definition.

Parameters:
  • id (str) – identifier of the vault in DSS

  • region_or_endpoint (str) – AWS region or custom endpoint for the remote vault

  • auth_config (AWSSecretsManagerAuthConfigBase) – optional authentication configuration, defaults to environment-based auth

  • cache_settings (DSSVaultCacheSettings) – optional cache settings for remote secret resolution

  • permission_items (list) – optional list of permission item dicts

  • description (str) – optional description of the vault

  • allowed_remote_secret_identifier_regex (str) – optional regex restricting remote secret identifiers allowed through this vault

Returns:

handle to the created vault

Return type:

DSSVault

create_azure_key_vault_vault(id, vault_url, auth_config=None, permission_items=None, description=None, allowed_remote_secret_identifier_regex=None, cache_settings=None)

Create a new Azure Key Vault definition.

Parameters:
  • id (str) – identifier of the vault in DSS

  • vault_url (str) – Azure Key Vault URL for the remote vault

  • auth_config (AzureKeyVaultAuthConfigBase) – optional authentication configuration, defaults to environment-based auth

  • cache_settings (DSSVaultCacheSettings) – optional cache settings for remote secret resolution

  • permission_items (list) – optional list of permission item dicts

  • description (str) – optional description of the vault

  • allowed_remote_secret_identifier_regex (str) – optional regex restricting remote secret identifiers allowed through this vault

Returns:

handle to the created vault

Return type:

DSSVault

create_gcp_secret_manager_vault(id, project_id, psc_endpoint_id=None, endpoint=None, auth_config=None, permission_items=None, description=None, allowed_remote_secret_identifier_regex=None, cache_settings=None)

Create a new Google Cloud Secret Manager vault definition.

Parameters:
  • id (str) – identifier of the vault in DSS

  • project_id (str) – GCP project ID containing the remote secrets

  • psc_endpoint_id (str) – optional Private Service Connect endpoint ID

  • endpoint (str) – optional custom GCP Secret Manager endpoint

  • auth_config (GCPSecretManagerAuthConfigBase) – optional authentication configuration, defaults to environment-based auth

  • cache_settings (DSSVaultCacheSettings) – optional cache settings for remote secret resolution

  • permission_items (list) – optional list of permission item dicts

  • description (str) – optional description of the vault

  • allowed_remote_secret_identifier_regex (str) – optional regex restricting remote secret identifiers allowed through this vault

Returns:

handle to the created vault

Return type:

DSSVault

class dataikuapi.secretsmanager.vaultsmanager.DSSVault(client, vault_id, vault_type=None, description=None, permission_items=None, allowed_remote_secret_identifier_regex=None, cache_settings=None, region_or_endpoint=None, vault_url=None, project_id=None, psc_endpoint_id=None, endpoint=None, auth_config=None)

Handle for a specific DSS vault.

Important

Do not instantiate directly, use DSSVaultsManager.list_vaults() or DSSVaultsManager.get_vault() instead

classmethod from_raw(client, raw)
property created_by

Get the user that created the vault.

property last_updated_by

Get the user who last updated the vault.

property created_on

Get the date and time when the vault was created.

Return type:

datetime.datetime

property last_updated_on

Get the date and time of the latest vault update.

Return type:

datetime.datetime

save()

Persist updates made to this vault handle.

The local object fields are sent back to DSS, then refreshed from the server response.

Returns:

self

Return type:

DSSVault

list_referencing_secret_identifiers()

List DSS secret identifiers currently backed by this vault.

Returns:

list of secret identifier strings

Return type:

list

delete()

Delete this vault definition from DSS.

Returns:

self

Return type:

DSSVault

class dataikuapi.secretsmanager.vaultsmanager.DSSVaultCacheSettings(max_caching_minutes=5)

Cache settings attached to a DSS vault definition.

static from_raw(raw)
get_raw()
class dataikuapi.secretsmanager.vaultsmanager.DSSVaultType(*values)

Enumeration of vault provider types supported by DSS.

AWS_SECRETS_MANAGER = 'AWS_SECRETS_MANAGER'
AZURE_KEY_VAULT = 'AZURE_KEY_VAULT'
GCP_SECRET_MANAGER = 'GCP_SECRET_MANAGER'

AWS authentication

class dataikuapi.secretsmanager.vaultsmanager.AWSEnvironmentAuthConfig

Use environment-provided AWS credentials when accessing the remote vault.

get_raw()

Serialize this authentication configuration to the DSS payload format.

Returns:

raw authentication configuration

Return type:

dict

class dataikuapi.secretsmanager.vaultsmanager.AWSIAMRoleAuthConfig(role_arn, external_id=None, duration_seconds=None, sts_endpoint=None)

Use an AWS IAM role assumption flow when accessing the remote vault.

get_raw()

Serialize this authentication configuration to the DSS payload format.

Returns:

raw authentication configuration

Return type:

dict

class dataikuapi.secretsmanager.vaultsmanager.AWSKeypairAuthConfig(access_key, secret_key, session_token=None)

Use an explicit AWS access key / secret key pair when accessing the remote vault.

get_raw()

Serialize this authentication configuration to the DSS payload format.

Returns:

raw authentication configuration

Return type:

dict

class dataikuapi.secretsmanager.vaultsmanager.AWSSecretsManagerAuthConfigBase

Base class for AWS Secrets Manager vault authentication configurations.

Do not instantiate this class directly. Use one of the concrete subclasses to describe how DSS should authenticate against the remote AWS Secrets Manager service.

static from_raw(raw)

Build the appropriate authentication config object from a raw DSS payload.

Parameters:

raw (dict) – raw authentication configuration as returned by DSS

Returns:

typed authentication configuration

Return type:

AWSSecretsManagerAuthConfigBase

get_raw()

Serialize this authentication configuration to the DSS payload format.

Returns:

raw authentication configuration

Return type:

dict

class dataikuapi.secretsmanager.vaultsmanager.AWSSecretsManagerAuthMode(*values)

Enumeration of authentication modes supported for AWS Secrets Manager vaults.

ENVIRONMENT = 'ENVIRONMENT'
IAM_ROLE = 'IAM_ROLE'
KEYPAIR = 'KEYPAIR'

Azure authentication

class dataikuapi.secretsmanager.vaultsmanager.AzureEnvironmentAuthConfig(authority_host=None)

Use environment-provided Azure credentials when accessing the remote vault.

get_raw()

Serialize this authentication configuration to the DSS payload format.

Returns:

raw authentication configuration

Return type:

dict

class dataikuapi.secretsmanager.vaultsmanager.AzureManagedIdentityAuthConfig(managed_identity_resource_id=None)

Use Azure managed identity when accessing the remote vault.

get_raw()

Serialize this authentication configuration to the DSS payload format.

Returns:

raw authentication configuration

Return type:

dict

class dataikuapi.secretsmanager.vaultsmanager.AzureClientSecretAuthConfig(tenant_id, client_id, client_secret, authority_host=None)

Use an explicit Azure application client secret when accessing the remote vault.

get_raw()

Serialize this authentication configuration to the DSS payload format.

Returns:

raw authentication configuration

Return type:

dict

class dataikuapi.secretsmanager.vaultsmanager.AzureClientCertificateAuthConfig(tenant_id, client_id, certificate_path, password=None, authority_host=None)

Use an Azure application client certificate when accessing the remote vault.

get_raw()

Serialize this authentication configuration to the DSS payload format.

Returns:

raw authentication configuration

Return type:

dict

class dataikuapi.secretsmanager.vaultsmanager.AzureKeyVaultAuthConfigBase

Base class for Azure Key Vault authentication configurations.

Do not instantiate this class directly. Use one of the concrete subclasses to describe how DSS should authenticate against the remote Azure Key Vault service.

static from_raw(raw)

Build the appropriate authentication config object from a raw DSS payload.

Parameters:

raw (dict) – raw authentication configuration as returned by DSS

Returns:

typed authentication configuration

Return type:

AzureKeyVaultAuthConfigBase

get_raw()

Serialize this authentication configuration to the DSS payload format.

Returns:

raw authentication configuration

Return type:

dict

class dataikuapi.secretsmanager.vaultsmanager.AzureKeyVaultAuthMode(*values)

Enumeration of authentication modes supported for Azure Key Vault vaults.

ENVIRONMENT = 'ENVIRONMENT'
MANAGED_IDENTITY = 'MANAGED_IDENTITY'
CLIENT_SECRET = 'CLIENT_SECRET'
CLIENT_CERTIFICATE = 'CLIENT_CERTIFICATE'

Google Cloud authentication

class dataikuapi.secretsmanager.vaultsmanager.GCPEnvironmentAuthConfig(universe_domain=None, impersonate_service_account_after_initial_auth=False, service_account_to_impersonate_after_initial_auth=None, perform_wif_token_exchange=False, wif_pool_provider_incoming_audience=None, wif_token_audience=None, wif_token_endpoint=None)

Use Google Application Default Credentials when accessing the remote vault.

get_raw()

Serialize this authentication configuration to the DSS payload format.

class dataikuapi.secretsmanager.vaultsmanager.GCPKeypairAuthConfig(app_secret_content, service_account_email=None, universe_domain=None, impersonate_service_account_after_initial_auth=False, service_account_to_impersonate_after_initial_auth=None, perform_wif_token_exchange=False, wif_pool_provider_incoming_audience=None, wif_token_audience=None, wif_token_endpoint=None)

Use a GCP service account key or path when accessing the remote vault.

get_raw()

Serialize this authentication configuration to the DSS payload format.

class dataikuapi.secretsmanager.vaultsmanager.GCPSecretManagerAuthConfigBase(universe_domain=None, impersonate_service_account_after_initial_auth=False, service_account_to_impersonate_after_initial_auth=None, perform_wif_token_exchange=False, wif_pool_provider_incoming_audience=None, wif_token_audience=None, wif_token_endpoint=None)

Base class for GCP Secret Manager vault authentication configurations. Do not instantiate directly.

static from_raw(raw)

Build the appropriate authentication config object from a raw DSS payload.

Parameters:

raw (dict) – raw authentication configuration as returned by DSS

Returns:

typed authentication configuration

Return type:

GCPSecretManagerAuthConfigBase

get_raw()

Serialize this authentication configuration to the DSS payload format.

class dataikuapi.secretsmanager.vaultsmanager.GCPSecretManagerAuthMode(*values)

Enumeration of authentication modes supported for GCP Secret Manager vaults.

ENVIRONMENT = 'ENVIRONMENT'
KEYPAIR = 'KEYPAIR'