Teller Secret Manager

repository·master·Indexed 25 days ago

https://github.com/tellerops/teller

An open-source universal secret manager (v2.0.7) that allows developers to interact with secret stores like HashiCorp Vault, AWS, Google, and others directly from the terminal. It provides tools to inject secrets into subprocesses, Docker containers, and shell sessions without manual .env management. Key features include secret scanning for CI/CD, log redaction, Tera-based templating, and the ability to sync or write secrets across different providers.

Tokens
8.3K
Snippets
25
Records
77
Agent score
85%

What's inside Teller

  1. Initialize a new Teller configuration

    master

    Run teller new to start an interactive setup. You will be prompted to select your secret providers (e.g., hashicorp, aws_secretsmanager, ssm, dotenv, google_secretmanager, hashicorp_consul). This creates a .teller.yml file.

    $ teller new
  2. Configure `.teller.yml` providers and maps

    master

    The .teller.yml file defines providers and their maps. Each map contains:

    • id: A unique identifier for the map used in CLI operations.
    • path: The root path to fetch key-values from (supports Tera templating like {{ get_env(...) }}).
    • keys: (Optional) A mapping to rename keys.
      • Use == to map to the same key name.
      • Use KEY_NAME: NEW_NAME to rename a key from the source to a new name.

    Example configuration:

    providers:
      hashi_1:
        kind: hashicorp
        maps:
          - id: test-load
            path: /{{ get_env(name="TEST_LOAD_1", default="test") }}/users/user1
            keys:
              GITHUB_TOKEN: ==
              mg: FOO_BAR
      dot_1:
        kind: dotenv
        maps:
          - id: stg
            path: VAR_{{ get_env(name="STAGE", default="development") }}
  3. Use template variables in teller configuration

    master
    Teller supports template rendering in its configuration files using the Tera templating engine. This allows you to inject variables into your teller.yml at runtime. When using Config::with_vars, you can pass a map of variables that will be interpolated into the configuration text before it is parsed as YAML.
  4. Configure the Dotenv provider

    master

    To use a .env file as a secret manager provider in Teller, define a provider with the kind: dotenv in your configuration. You can optionally specify create_on_put to allow Teller to create the file if it does not already exist when writing new data.

    providers:
     dotenv1:
       kind: dotenv
       create_on_put: true
    providers:
     dotenv1:
       kind: dotenv
       # options: ...
  5. Configure the HashiCorp Consul provider

    master

    To use HashiCorp Consul as a secret provider in Teller, add it to your teller.yml configuration. You can specify the connection details under the provider name using the kind: hashicorp_consul identifier.

    Available options:

    • address: The Consul server address. If not provided, Teller will look for the CONSUL_HTTP_ADDR environment variable.
    • token: The Consul ACL token. If not provided, Teller will look for the CONSUL_HTTP_TOKEN environment variable.
    • dc: The specific datacenter to query.
    providers:
     consul1:
       kind: hashicorp_consul
       # options: ...
  6. Map secrets using PathMap

    master

    The PathMap defines how Teller interacts with a specific path in a provider and how it transforms the keys found there.

    Key configuration options:

    • id: A unique identifier for this mapping.
    • path: The path within the provider to scan for secrets.
    • protocol: (Optional) The protocol to use for this path.
    • keys: A map of from_key: to_key. If this is empty, all keys found at the path are mapped to themselves. If populated, only the specified keys are mapped, and they are renamed to the value in the map.
    • decrypt: Boolean indicating if the values should be decrypted.
    • sensitivity: The Sensitivity level of the secrets (None, Low, Medium, High, Critical).
    • redact_with: (Optional) A string used to redact the secret in logs or output.
    • source / sink: (Optional) Metadata indicating where the secret comes from or where it is going.
    • optional: If true, failure to populate this path will not cause an error.
  7. Configure the Google Secret Manager provider

    master

    To use Google Secret Manager (GSM) as a provider in teller, add it to your configuration file under the providers key. Use kind: google_secretmanager to specify the provider type.

    Authentication

    The provider uses the default Google Cloud Application Default Credentials (ADC) strategy. It searches for credentials in the following order:

    1. The path specified in the GOOGLE_APPLICATION_CREDENTIALS environment variable.
    2. The file $HOME/.config/gcloud/application_default_credentials.json.

    If you require specific configuration options, please open an issue in the repository.

    providers:
     gsm1:
      kind: google_secretmanager
      # options: ...
  8. Configure the AWS SSM provider

    master

    To use AWS SSM as a secret provider in Teller, define a provider with kind: ssm in your teller.yml. You can provide simplified configuration options to specify credentials, region, and endpoint URL.

    If no options are provided, Teller will attempt to use the default AWS SDK credential loading chain (e.g., environment variables, IAM roles, or shared credentials file).

  9. Configure key mapping with the '==' operator

    master

    In your teller.yml configuration, you can use the == operator within your provider maps to indicate that a secret should be mapped to a key with the same name.

    If you provide a value other than ==, the key on the left side of the mapping is transformed into the key name on the right side. For example, if you have a mapping original_key: new_key, the secret from original_key will be available as new_key.