The External Secrets Enterprise product suite is a premium product.
It requires a specific subscription. Contact us for more information.
In order to use the Basic Auth Generator, you must have the Enterprise Distribution of ESO available via ESI Agent or via our Helm chart bundle

Introduction

The Basic Auth Generator allows you to automatically generate random usernames and passwords for use with Basic Authentication schemes. This is useful for generating credentials for internal services, CI pipelines, or any scenario where unique, scoped credentials are needed without relying on external identity providers.

Output Keys and Values

KeyDescription
usernameThe generated username
passwordThe generated password

Parameters

username Configuration

FieldDefaultDescription
length8Length of each word in the username.
prefix""Optional prefix added to the beginning of the username.
sufix""Optional suffix added to the end of the username.
wordCount1Number of words in the username.
separator"_"Character used to separate words.
includeNumbersfalseWhether to add 4 random digits at the end of the username after the suffix.

password Configuration

This field supports the same parameters as the Password Generator, allowing fine-grained control over password complexity.

Set up

Generator Config

apiVersion: generators.external-secrets.io/v1alpha1
kind: BasicAuth
metadata:
  name: basic-auth-generator
  namespace: default
spec:
  username:
    length: 6
    wordCount: 2
    separator: "-"
    prefix: "app"
    sufix: "user"
    includeNumbers: true
  password:
    length: 20
    includeUpperCase: true
    includeLowerCase: true
    includeDigits: true
    includeSymbols: true

ExternalSecret Config

apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata:
  name: basic-auth-secret
  namespace: default
spec:
  refreshInterval: 1h
  dataFrom:
    - sourceRef:
        generatorRef:
          apiVersion: generators.external-secrets.io/v1alpha1
          kind: BasicAuth
          name: basic-auth-generator

Using the Generated Secret

apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-app
  namespace: default
spec:
  replicas: 1
  selector:
    matchLabels:
      app: my-app
  template:
    metadata:
      labels:
        app: my-app
    spec:
      containers:
        - name: my-container
          image: my-image:latest
          env:
            - name: BASIC_AUTH_USERNAME
              valueFrom:
                secretKeyRef:
                  name: basic-auth-secret
                  key: username
            - name: BASIC_AUTH_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: basic-auth-secret
                  key: password

Notes and Considerations

  • This generator combines the behavior of the Username and Password generators for convenience.
  • Password field supports full customization as described in the Password Generator documentation.
  • The suffix and prefix are added to the username as literal strings—separated by the configured separator.
  • includeNumbers appends 4 digits after the suffix and is useful for ensuring uniqueness.