OpenBao chart

  • Tier: Premium, Ultimate
  • Offering: GitLab Self-Managed

You can use the OpenBao chart to install OpenBao, which is required to enable the GitLab secrets manager.

Known limitations

  • You can’t upgrade OpenBao without downtime. Zero downtime upgrades are proposed in issue 595721.
  • You can’t deploy OpenBao with GitLab Operator. Support is proposed in issue 1933.
  • A FIPS variant of the OpenBao image is already being built, but OpenBao is not FIPS validated. FIPS validation is tracked in GitLab issue 574875.
  • When failing over to a Geo secondary site that uses a different domain (instead of updating DNS to point the primary domain to the secondary site), OpenBao requires manual re-provisioning of JWT authentication for all projects and groups where GitLab Secrets Manager is enabled. This process can be time-consuming for large deployments. A migration tool is being proposed in GitLab issue 595722. Until then, the recommended approach is to update DNS records so the primary domain points to the promoted secondary site.

Setup GitLab secret manager and OpenBao

  1. On an existing GitLab instance, enable OpenBao and configure its database connection. OpenBao requires a separate PostgreSQL database that you must create first. For the database and password secret, see Database configuration.

    yaml
    # Enable OpenBao integration
    global:
      openbao:
        enabled: true
        # Connect to the separate OpenBao database you created
        psql:
          host: "psql.openbao.example.com"
          password:
            secret: openbao-db-password
            key: password
    # Install bundled OpenBao
    openbao:
      install: true
  2. In GitLab, on the top bar, select Search or go to and find your project.

  3. Select Settings > General.

  4. Expand Visibility, project features, permissions.

  5. Turn on the Secrets Manager toggle, and wait for the Secrets Manager to be provisioned.

Rolling back OpenBao upgrades

OpenBao upgrades can make changes to the PostgreSQL data that are not backwards compatible, which can cause compatibility issues if the OpenBao upgrade must be rolled back.

You should always back up before upgrading OpenBao. If you need to roll back an OpenBao upgrade, also restore the database backup matching the OpenBao version.

For more information, see OpenBao upgrade documentation.

Back up OpenBao

A complete OpenBao backup includes the:

  • OpenBao unseal key
  • OpenBao PostgreSQL database

With static auto unsealing, the Toolbox does not back up the unseal key. Save a copy of the <release>-openbao-unseal secret yourself:

shell
umask 077
kubectl --namespace <namespace> get secret <release>-openbao-unseal -o jsonpath='{.data}' > openbao-unseal-backup.json

Store openbao-unseal-backup.json as securely as the secret itself. The values in it are base64 encoded, not encrypted. The unseal key is not in the database, so a database restore does not recover it.

With AWS KMS unsealing, there is no unseal key to back up. The key stays in AWS KMS, and OpenBao calls KMS to decrypt the root key on every pod start. Protect access to the key instead, as AWS KMS unsealing describes.

The Toolbox backs up the OpenBao database as part of the standard GitLab backup, when backup credentials are configured.

Back up the OpenBao database at the same time as the main GitLab PostgreSQL database to avoid data inconsistencies.

Restore OpenBao

The Toolbox restores the OpenBao database as part of the standard GitLab restore. See OpenBao database credentials to configure restore credentials.

Before restoring an OpenBao backup:

  1. Note the current replica count so you can restore it afterward.

  2. Scale down OpenBao so the running pod does not race the DROP TABLE and CREATE TABLE statements in the dump:

    shell
    kubectl get deploy -lapp.kubernetes.io/name=openbao,app.kubernetes.io/instance=<helm release name> -n <namespace>
    kubectl scale deploy -lapp.kubernetes.io/name=openbao,app.kubernetes.io/instance=<helm release name> -n <namespace> --replicas=0

After the restore completes, scale OpenBao back to its previous replica count so it reads from the restored database:

shell
kubectl scale deploy -lapp.kubernetes.io/name=openbao,app.kubernetes.io/instance=<helm release name> -n <namespace> --replicas=<previous count>

OpenBao configuration options

The following tables list all available OpenBao configuration options. Global chart settings, such as Ingress configuration and image tag suffixes, also apply to OpenBao.

Installation command-line options

The table below contains all the possible charts configurations that can be supplied to the helm install command using the --set flags.

ParameterDefaultDescription
config.logLevelinfoOpenBao log level.
config.logRequestsLeveloffOpenBao request log level. To enable request logging set this to the same value as config.logLevel or a higher level.
config.logFormatjsonOpenBao log format. Either json or standard.
nameOverrideOverride the chart name.
fullnameOverrideOverride the fully qualified app name.
serviceAccount.createtrueCreate a service account for OpenBao.
serviceAccount.automounttrue
serviceAccount.annotations{}Additional service account annotations.
serviceAccount.nameOverride the generated service account name.
role.createCreate a role with necessary RBAC permissions.
securityContext.capabilities{ drop: ["ALL"] }
securityContext.runAsNonRoottrue
securityContext.allowPrivilegeEscalationfalse
securityContext.runAsUser1000
podSecurityContext.seccompProfileRuntimeDefault
podSecurityContext.runAsUser1000
podSecurityContext.fsGroup1000
serviceActive.typeClusterIPService type of the active OpenBao pod.
serviceActive.annotations{}Service annotations of the active OpenBao pod.
serviceInactive.typeClusterIPService type of the standby OpenBao pods.
serviceInactive.annotations{}Service annotations of the standby OpenBao pods.
resources{}Resource limits and requests.
autoscaling.minReplicas2Minimum OpenBao replicas.
autoscaling.maxReplicas2Maximum OpenBao replicas.
autoscaling.targetCPUUtilizationPercentage80Target CPU utilization for autoscaling.
autoscaling.targetMemoryUtilizationPercentageTarget memory utilization for autoscaling.
livenessProbeOpenBao liveness probe. Check OpenBao values for the default.
readinessProbeOpenBao readiness probe. Check OpenBao values for the default.
nodeSelector{}Node selector labels.
tolerations[]Toleration labels for pod assignment.
affinity{}Affinity labels for pod assignment.
podAnnotations{}Annotations to add to the OpenBao pods.
podLabels{}Labels to add to the OpenBao pods.
extraVolumesAdditional volumes for the OpenBao pods.
extraVolumeMountsAdditional volume mounts for the OpenBao container.
config.uifalseEnable the OpenBao UI.
config.clusterPort8201OpenBao cluster port.
config.apiPort8200OpenBao API port.
config.cacheSize2560Size of the read cache used by the physical storage subsystem as a number of entries.
config.maxRequestSize786432Maximum request size in bytes. Default is 768KB.
config.maxRequestJsonMemory1048576Maximum size of the JSON-parsed request body in bytes. Default is 1MB.

Container image options

The OpenBao chart deploys a cloud-native GitLab container image to deploy OpenBao. The OpenBao build includes modifications from the upstream version. As a result, some functionality may differ from the standard OpenBao releases.

ParameterDefaultDescription
image.repositoryregistry.gitlab.com/gitlab-org/build/cng/gitlab-openbaoRepository of the OpenBao image.
image.pullPolicyIfNotPresentImage pull policy.
image.tagOverride this to deploy a custom OpenBao version.
imagePullSecrets[]Secrets to pull images from private repositories.

Ingress and TLS configuration options

The OpenBao chart defaults to Ingress-terminated TLS encryption.

ParameterDefaultDescription
global.openbao.hostopenbao.<GitLab Domain>OpenBao host. Used to configure GitLab webservice and the OpenBao chart.
global.openbao.urlDerived from hostOpenBao URL for GitLab. If present, must be a complete URI.
global.openbao.jwt_audienceSame as urlJWT audience claim for OpenBao authentication. Must match OpenBao bound_audiences. For Geo deployments, see Geo deployment.
global.openbao.psql{}OpenBao database config (host, database, username, password).
ingress.enabledtrueEnable the OpenBao Ingress to allow Runner to reach OpenBao.
ingress.hostnameExternal OpenBao host based on global hosts config.Hostname the Ingress should match.
ingress.tls.enabledtrueEnable Ingress TLS.
ingress.tls.secretNameName of the Kubernetes TLS Secret. Managed by certmanager by default.
tlsSecretNameName of the TLS secret mounted internally. Defaults to the Ingress TLS secret.
ingress.annotationstrueAnnotations rendered to the Ingress. Use this to configure OpenBao for any non-NGINX Ingress controllers.
ingress.configureCertmanagerGlobal certmanager configUse certmanager to manage the TLS certificate.
ingress.certmanagerIssuer<release>-issuerName of the certmanager issuer.
ingress.sslPassthroughNginxfalseAnnotate the Ingress to pass through incoming TLS connections to OpenBao. If certmanager is configured, new HTTP01 challanges will be through another Ingress.
config.tlsDisabletrueDisable internal TLS. If disabled, Ingress TLS passthrough is also disabled.
config.metricsListener.tlsDisabletrueDisable internal TLS of the metrics listener.

You should operate OpenBao with end-to-end encrypted TLS. To enable end-to-end TLS configure, OpenBao to expect a TLS connection and pass the TLS connection through NGINX Ingress:

yaml
global:
  ingress:
    useNewIngressForCerts: true
config:
  tlsDisable: false
ingress:
  sslPassthroughNginx: true

Enabling SSL passthrough requires cert-manager to create another Ingress to complete HTTP01 challanges. If you use the bundled certmanager and Issuer, make sure the Issuer sets the correct IngressClass by configuring global.ingress.useNewIngressForCerts.

Do not combine SSL passthrough with the X-Forwarded-For options.

Gateway API

The OpenBao chart allows to expose traffic via an HTTPRoute. If Gateway API is enabled globally, a listener for OpenBao will be created in the managed Gateway resource.

ParameterDefaultDescription
gatewayRoute.enabledDefaults to value of global.gatewayApi.enabledEnable exposing OpenBao via a HTTPRoute.
gatewayRoute.sectionNameopenbao-webGateway section to be used by the HTTPRoute.
gatewayRoute.gatewayNameGitLab chart managed GatewayGateway name to be used by the HTTPRoute.
gatewayRoute.annotations{}Extra annotations for the HTTPRoute.
gatewayRoute.timeouts{}Custom timeout config for the HTTPRoute.

Monitoring configuration options

OpenBao is preconfigured to expose Prometheus metrics which will be scraped by the bundled Prometheus subchart.

ParameterDefaultDescription
config.telemetry.enabledtrueEnable telemetry and monitoring.
config.telemetry.disableHostnametruePrefix gauge values with local hostname.
config.telemetry.prometheusRetentionTime24hMetrics retention time.
config.telemetry.metricsPrefixopenbaoPrefix for all metrics.
config.telemetry.usageGaugePeriod0Interval at which high-cardinality usage data is collected, such as token counts, entity counts, and secret counts.
config.telemetry.numLeaseMetricsBuckets1Number of expiry buckets for leases.
config.telemetry.prefixFilterMetric prefixes to include (+) or exclude (-) from telemetry. Check OpenBao values for the default.
config.metricsListener.enabledtrueEnable a second API port to serve requests for metrics. The listener can serve all API requests, but serves requests for metrics without authentication.
config.metricsListener.tlsDisabletrueDisable internal TLS of the metrics listener.
config.metricsListener.port8209Port of the metrics listener.
config.metricsListener.unauthenticatedMetricsAccesstrueAllow requests for metrics to be served without authentication.
podMonitor.enabledfalseEnable PodMonitor resource for Prometheus Operator. Requires Prometheus Operator to be installed in the cluster.
podMonitor.additionalLabels{}Additional labels to add to the PodMonitor resource.
podMonitor.selectorLabels{}Additional selector labels to filter which pods to scrape.
podMonitor.endpointConfig{}Additional endpoint configuration (for example, interval, scrapeTimeout).

Unsealing and initialization options

The OpenBao chart supports two mutually exclusive auto-unseal methods:

It also uses OpenBao declarative self initialization.

A recovery key gives emergency access when JWT authentication is unavailable. Because self initialization generates no recovery key, you create and store one by running the gitlab:secrets_management:openbao:recovery_key:store Rake task in the Toolbox pod.

Until you store a recovery key, OpenBao logs post-unseal upgrade seal keys failed: error="no recovery key found" errors on every start. You must store the key before rotating the static unseal key.

For the command and the other recovery key tasks, see recovery key management.

ParameterDefaultDescription
global.openbao.unseal.currentKeyFieldkeyField of the unseal secret holding the current key.
global.openbao.unseal.previousKeyFieldField of the unseal secret holding the previous key, used to rotate the key. Set with config.unseal.static.previousKeyId, or leave both empty. Setting one alone stops the chart from rendering.
config.unseal.static.enabledtrueEnable static auto unsealing.
config.unseal.static.currentKeyIdgl-unseal-1ID of the current static unsealing key.
config.unseal.static.currentKey/srv/openbao/keys/gl-unseal-1Path of the current static unsealing key.
config.unseal.static.previousKeyIdID of the previous static unsealing key, used to rotate the key. Set with previousKey, or leave both empty.
config.unseal.static.previousKeyPath of the previous static unsealing key. Set with previousKeyId, or leave both empty. Setting one alone stops the chart from rendering.
config.unseal.awskms.enabledfalseEnable AWS KMS auto-unsealing.
config.unseal.awskms.kmsKeyIdKMS key ID, ARN, or alias (for example, alias/my-openbao-key). Required when config.unseal.awskms.enabled is true.
config.unseal.awskms.regionAWS region where the KMS key resides.
config.unseal.awskms.endpointOptional custom KMS endpoint URL (for example, a VPC endpoint).
config.initialize.enabledtrueEnable OpenBao self initialization.
config.initialize.oidcDiscoveryUrlExternal GitLab hostOIDC discovery URL. Defaults to the external GitLab hostname.
config.initialize.boundIssuerExternal GitLab hostIssuer URL. Defaults to the external GitLab hostname.
config.initialize.boundAudiencesExternal OpenBao hostOIDC role audiences. Defaults to the external OpenBao hostname.
staticUnsealSecret.generatefalseGenerate a static key to auto unseal OpenBao. Defaults to false as managed by GitLab charts shared-secret chart.
initializeTplTemplate passed to self initialize OpenBao. Check OpenBao values for the default.

Rotate the static unseal key

Rotating the static unseal key means running the new key alongside the old one until OpenBao re-encrypts its root key with the new key. You then remove the old key.

The keys are fields of the <release>-openbao-unseal secret:

  • global.openbao.unseal.currentKeyField names the field holding the current key.
  • global.openbao.unseal.previousKeyField names the field holding the previous key.

Rotation adds the new key under a new field, so no key is overwritten. Name each field so you can tell which key it holds.

To undo a rotation, see Undo a static unseal key rotation.

On Geo deployments, follow Rotate the static unseal key on Geo deployments, which adds steps on every secondary site.

Before you start, save a copy of the <release>-openbao-unseal secret and back up the OpenBao database. If you remove the old key before OpenBao finishes re-encrypting its root key, OpenBao cannot unseal. That copy is the only way back.

Prerequisites:

  • A stored recovery key. To create and store a recovery key, see recovery key management. Because OpenBao re-encrypts the recovery key before the root key and stops on the first failure, without a stored recovery key the re-encryption never runs and the rotation cannot complete.
  • A backed up <release>-openbao-unseal secret and a backed up OpenBao database.

To rotate the static unseal key:

  1. Generate a new key. Use 32 raw bytes, not base64 text. Set a restrictive umask first, because openssl applies your shell’s current umask to the new file:

    shell
    umask 077
    openssl rand -out newkey 32
  2. Add the new key to the secret under a new field. Leave the existing fields alone. Build the patch in a file with a restrictive umask, apply it with --patch-file, then delete the file, so the key never reaches your shell history or the process list:

    shell
    NEW=$(base64 < newkey | tr -d '\n')
    umask 077
    cat > unseal-patch.json <<EOF
    {"data":{"gl-unseal-2":"${NEW}"}}
    EOF
    kubectl --namespace <namespace> patch secret <release>-openbao-unseal --type merge --patch-file unseal-patch.json
    rm -f unseal-patch.json
  3. Point the configuration at the new key and keep the old one as the previous key, then run helm upgrade. Never reuse an ID for a new key.

    Add the new key to the secret before you name its field in currentKeyField or previousKeyField. If you name a field the secret does not have, the pods fail to start and log an is a directory error for that key path.

    yaml
    global:
      openbao:
        unseal:
          currentKeyField: "gl-unseal-2"
          previousKeyField: "key"
    openbao:
      config:
        unseal:
          static:
            currentKeyId: "gl-unseal-2"
            currentKey: "/srv/openbao/keys/gl-unseal-2"
            previousKeyId: "gl-unseal-1"
            previousKey: "/srv/openbao/keys/gl-unseal-1"

    previousKeyField is whatever currentKeyField was before this change. On a chart that has never rotated, that is key.

    The upgrade restarts the OpenBao pods. The OpenBao Deployment uses the Recreate strategy, so all pods stop before new ones start, and OpenBao is unavailable until the new pods are ready. Wait for the new pods before you continue.

  4. Confirm the re-encryption performed by the active pod (labeled openbao-active=true). Its logs must show both upgrading stored keys and upgrading recovery key, and no post-unseal upgrade seal keys failed error:

    shell
    ACTIVE=$(kubectl --namespace <namespace> get pod -l app.kubernetes.io/name=openbao,app.kubernetes.io/instance=<release>,openbao-active=true -o name)
    kubectl --namespace <namespace> logs "$ACTIVE" -c openbao-server | grep -E 'upgrading stored keys|upgrading recovery key|post-unseal upgrade seal keys failed'

    If you see the failed line, or either upgrading line is missing, the re-encryption did not complete. Investigate before you continue. Pod health does not tell you: the pod reports itself unsealed even when the re-encryption failed. The no recovery key found error means no recovery key is stored, so the re-encryption was never attempted. Store a recovery key, then restart the pods.

    On Geo deployments, run this check on the primary site. A secondary site logs the failed line until replication arrives, as Rotate the static unseal key on Geo deployments explains.

    Do not rotate again to a fresh key. The configuration names two keys at a time, regardless of how many the secret holds. A second rotation drops the key that still encrypts the root key, and OpenBao stops unsealing.

  5. Remove the old key.

    Remove the old key only after you confirm the re-encryption. If you remove the old key too early, OpenBao cannot unseal. A recovery key does not help, because a recovery key authorizes operations and never decrypts the root key.

    Remove previousKeyId, previousKey, and previousKeyField from your values and run helm upgrade:

    shell
    helm upgrade --install <release> gitlab/gitlab --namespace <namespace> -f <values>.yaml

    Wait for the new pods to be ready, then delete the field the old key was in. In this example that field is key. In your case it is whatever previousKeyField named. If you delete the field before the new pods are ready, a pod that restarts on the old configuration fails to start:

    shell
    kubectl --namespace <namespace> patch secret <release>-openbao-unseal --type=json \
      -p '[{"op":"remove","path":"/data/key"}]'
  6. Delete the temporary key file:

    shell
    rm -f newkey

    Your backup of the unseal secret still holds the old key. Store it as securely as the secret itself, or destroy it.

Rotate the static unseal key on Geo deployments

On Geo deployments, prefer AWS KMS unsealing with a multi-region key over a static key. A multi-region key has one set of key material, the secret bytes that encrypt and decrypt. Every site decrypts what the others encrypted, so rotation needs none of the steps below.

If you use a static key on a Geo deployment, the unseal secret is not replicated between sites. A secondary site runs on a read replica, so it cannot re-encrypt the root key for itself. The secondary site unseals with the old key, attempts the re-encryption, and cannot write the result. The failed attempt does not stop the secondary site from serving. Until database replication brings the re-encrypted root key, the secondary site logs post-unseal upgrade seal keys failed errors on every start.

To rotate the static unseal key on a Geo deployment:

  1. Generate one new key using the process in the main procedure. Use the same key on every site.
  2. On every secondary site, add the new key to the unseal secret and run helm upgrade with the same values as the primary site: currentKeyField, previousKeyField, currentKeyId, currentKey, previousKeyId, and previousKey.
  3. Rotate the primary site with the main procedure, up to and including confirming the re-encryption.
  4. Wait for the OpenBao database to replicate to every secondary site. Replication is what carries the re-encrypted root key, and replication is the only gate on the next step. Do not use a successful unseal as the check: while both keys are configured a secondary site unseals under either key, so a successful unseal cannot tell you whether the re-encrypted root key has arrived.
  5. Remove the old key on every site.

Undo a static unseal key rotation

How you undo the rotation depends on whether the active pod has finished re-encrypting the root key. Check with the log command in Rotate the static unseal key. Both paths need the old key still in the secret. If you have deleted its field, restore the secret from your backup first.

Before the re-encryption completes, the root key is still encrypted with the old key:

  1. Restore the values you had before the rotation.
  2. Run helm upgrade and wait for the pods to be ready.
  3. Delete the field holding the new key.

After the re-encryption completes, the root key is encrypted with the new key, so the pair swaps instead:

  1. Make the old key current again and the new key previous. Swap currentKeyField and previousKeyField, and swap the IDs and paths with them.
  2. Run helm upgrade and wait for the pods to be ready.
  3. Confirm the re-encryption back to the old key, with the same log check.
  4. Remove the new key, the way the main procedure removes the old one.

AWS KMS unsealing

AWS KMS unsealing delegates the unseal key to an AWS KMS key, removing the need to manage a static key secret.

When running on AWS (EKS, EC2), use IRSA or an instance profile so that no explicit AWS credentials are required. Annotate the OpenBao service account with the IAM role ARN:

yaml
openbao:
  serviceAccount:
    annotations:
      eks.amazonaws.com/role-arn: "arn:aws:iam::<account-id>:role/<role-name>"
  config:
    unseal:
      static:
        enabled: false
      awskms:
        enabled: true
        kmsKeyId: "alias/my-openbao-key"
        region: "us-east-1"

The IAM role needs only kms:Encrypt, kms:Decrypt, and kms:DescribeKey on the KMS key. OpenBao encrypts client side, so do not grant kms:GenerateDataKey.

Reference the key by an alias, such as alias/my-openbao-key, instead of a key ID or ARN. An alias lets you point OpenBao at a different key later without editing the chart values. The switch still needs a pod restart, and OpenBao then re-encrypts the root key. See Change the AWS KMS key.

For Geo deployments, use a multi-region KMS key and give each site a replica in its own region, so every site unseals locally. Grant the three permissions on the replica in every region.

OpenBao calls KMS Decrypt on every pod start, and CloudTrail records each call. Set alarms on AccessDenied for these calls, and on the key being disabled, scheduled for deletion, or having its policy changed. Each of these stops OpenBao from unsealing on its next restart.

Rotate the AWS KMS key

Automatic key rotation replaces the key material while the key itself stays the same, so it is transparent to OpenBao. The ARN does not change, and AWS decrypts with whichever version of the material encrypted the data. Take no action.

Change the AWS KMS key

Changing the key is a configuration change, not a seal migration, so do not run bao operator unseal -migrate.

Back up the OpenBao database before you start. Keep the old key enabled and not scheduled for deletion until you confirm the re-encryption in step 2. If OpenBao loses access to the key that still encrypts its root key, it cannot unseal. Secrets stay unavailable until you restore that access.

To move OpenBao to a different KMS key:

  1. Point OpenBao at the new key. On a Geo deployment, the new key must also be a multi-region key. What restarts the pods depends on how you reference the key:

    • If you set config.unseal.awskms.kmsKeyId to the new key, helm upgrade restarts the pods for you.

    • If you point the alias at a different key, nothing in the rendered configuration changes, so no pod restarts. Restart them yourself. Otherwise OpenBao never re-encrypts the root key:

      shell
      kubectl --namespace <namespace> rollout restart deployment -l app.kubernetes.io/name=openbao,app.kubernetes.io/instance=<release>
  2. Confirm the active pod re-encrypted its root key, using the log check in Rotate the static unseal key.

  3. On a Geo deployment, wait for the OpenBao database to replicate to every secondary site.

  4. Only then disable or delete the old key.

    If you disable or delete the old key before the re-encryption completes, OpenBao cannot unseal. Pointing an alias at a different key does not re-encrypt anything already encrypted with the old key.

X-Forwarded-For options

By default, OpenBao records the address of the connecting proxy, such as the Ingress controller, as the remote_address of each request in the audit log. To record the address of the client instead, configure OpenBao to trust the X-Forwarded-For header sent by your proxy.

The settings apply to the API listener only. They have no effect while config.xForwardedFor.authorizedAddrs is empty, so existing deployments are not affected.

ParameterDefaultDescription
config.xForwardedFor.authorizedAddrs[]List of CIDRs of the proxies whose X-Forwarded-For header OpenBao trusts. Setting at least one CIDR enables the feature. Must be a list.
config.xForwardedFor.hopSkips0Number of trusted proxy addresses to skip, counting from the end of the header. OpenBao uses the next address as the client address.
config.xForwardedFor.rejectNotPresentfalseReject requests that have no X-Forwarded-For header. Keep this false, because Kubernetes probes send requests without the header.
config.xForwardedFor.rejectNotAuthorizedfalseReject requests that have an X-Forwarded-For header but do not come from an address in authorizedAddrs. If false, OpenBao ignores the header and uses the address of the connection.

To enable the feature, set authorizedAddrs to the CIDR of the proxy pods that connect to OpenBao. With NGINX, these are the controller pods. With Gateway API, these are the Envoy proxy pods. These pods get their addresses from the cluster pod CIDR. For example, on GKE: gcloud container clusters describe <cluster> --location <location> --format='value(clusterIpv4Cidr)'.

yaml
openbao:
  config:
    xForwardedFor:
      authorizedAddrs:
        - 10.0.0.0/16

On the command line, pass the list in braces:

shell
--set 'openbao.config.xForwardedFor.authorizedAddrs={10.0.0.0/16}'

authorizedAddrs matches the address of the connection, not the addresses in the header. With the pod CIDR, any pod that can reach the OpenBao Service can set its own X-Forwarded-For header. This changes the client address recorded in the OpenBao audit log and in GitLab Secrets Manager audit events. Limit which pods can reach OpenBao on port 8200, for example with a NetworkPolicy, or give the proxy pods a dedicated pod range.

Do not use these settings with ingress.sslPassthroughNginx: true. With TLS passthrough, NGINX cannot change the X-Forwarded-For header, so any client can set its own.

Set hopSkips based on how requests reach OpenBao:

Path to OpenBaohopSkips
Layer 4 load balancer → NGINX or Envoy Gateway0
Layer 7 load balancer → Envoy Gateway1
Layer 7 load balancer → NGINX with use-forwarded-headers: "true" and compute-full-forwarded-for: "true" in nginx-ingress.controller.config1

With a layer 4 load balancer, the proxy must see the client address, for example with externalTrafficPolicy: Local. With a layer 7 load balancer and NGINX default settings, NGINX replaces the header, so OpenBao records the load balancer address.

If hopSkips is not smaller than the number of entries in the header, OpenBao rejects the request with HTTP 400. For example, hopSkips: 1 with NGINX default settings makes every request through the Ingress fail. Kubernetes probes send no header, so they still pass and the pods look healthy.

GitLab sends its requests to OpenBao through the same external URL as runners, unless you set global.openbao.internal_url or global.openbao.internal_host. If you set either, make sure those requests produce a header with more entries than hopSkips, or no header at all.

Audit event streaming options

The OpenBao chart configures auditing devices to stream events to GitLab.

ParameterDefaultDescription
global.openbao.httpAudit.secret<release>-openbao-audit-secretName of the secret storing the token shared between OpenBao and GitLab.
global.openbao.httpAudit.keytokenSecret key storing the shared token.
config.audit.http.enabledtrueEnable streaming of auditing events by using HTTP to GitLab.
config.audit.http.streamingUriInternal workhorse URLEndpoint to stream auditing events to.
config.audit.http.authTokenPath/srv/openbao/audit/gitlab-authPath the token shared with GitLab is mounted at.
config.audit.http.requestTimeoutGo duration string (for example, 5s) that bounds each audit-event HTTP POST to the streaming endpoint. Empty, the default, means no timeout.
auditTplTemplate that configures the OpenBao audit devices. Check OpenBao values for the default.
httpAuditSecret.generatefalseGenerate a secret to be shared with GitLab for authenticated auditing. Defaults to false as managed by GitLab charts shared-secret chart.
initializeTplTemplate passed to configure OpenBao auditing. Check OpenBao values for the default.

Change an existing HTTP audit device

OpenBao registers the HTTP audit device declaratively and does not support modifying a registered device in place. To change an audit device, remove the existing audit device and add a new device. Make all changes through the chart values.

The chart supports adding or removing config.audit.http.requestTimeout directly. It switches the audit device path so setting or clearing the timeout is a remove and add operation, not an in-place modification.

To change the timeout from one value to another, use two deploys to force that path switch:

  1. First set requestTimeout to empty.
  2. Set the new value.

Database configuration

OpenBao uses a separate logical database (openbao by default) for data isolation from the Rails backend.

Configure global.openbao.psql or openbao.config.storage.postgresql.connection with host, database, username, and password. You must create the database manually. Password is required and is not inherited from the main GitLab database.

To configure an external database:

  1. Create a PostgreSQL user and database on your database server:

    sql
    -- Create the OpenBao user
    CREATE USER openbao WITH PASSWORD '<password>';
    
    -- Create the OpenBao database
    CREATE DATABASE openbao OWNER openbao;
  2. Create a Kubernetes secret containing the password:

    shell
    kubectl create secret -n bao generic openbao-db-password --from-literal=password="<password>"
  3. Configure OpenBao to connect to your external database:

    yaml
    global:
      openbao:
        psql:
          host: "psql.openbao.example.com"
          port: 5432
          database: openbao
          username: openbao
          password:
            secret: openbao-db-password
            key: password

    This uses global.openbao.psql, which is the preferred location because it is also accessible by Toolbox for backup and restore operations. To set advanced connection options (such as sslMode, connectTimeout, or keepalive tuning), use openbao.config.storage.postgresql.connection alongside the global settings.

  4. Deploy or upgrade OpenBao. When starting, OpenBao automatically creates its database schema in the specified database.

PostgreSQL storage options

The following options tune the OpenBao PostgreSQL storage backend. Set them under openbao.config.storage.postgresql, in addition to the connection details in global.openbao.psql.

ParameterDefaultDescription
config.storage.postgresql.haEnabledtrueEnable high availability mode for PostgreSQL storage.
config.storage.postgresql.haTablenullTable used for high availability locks. Uses the OpenBao default when unset.
config.storage.postgresql.maxConnectRetries20Maximum number of database connection retry attempts.
config.storage.postgresql.maxIdleConnections2Maximum number of idle database connections.
config.storage.postgresql.maxParallel5Maximum number of parallel database operations.
config.storage.postgresql.skipCreateTablenullSkip automatic creation of the storage tables. Create them manually when set to true.
config.storage.postgresql.connection.keepalivesnullEnable TCP keepalive probes. Set to 1 to enable or 0 to disable.
config.storage.postgresql.connection.keepalivesCountnullNumber of TCP keepalive probes to send before dropping a connection.
config.storage.postgresql.connection.keepalivesIdlenullSeconds of inactivity before the first TCP keepalive probe.
config.storage.postgresql.connection.keepalivesIntervalnullSeconds between TCP keepalive probes.
config.storage.postgresql.connection.sslModenullPostgreSQL SSL mode, such as disable, require, or verify-full. When not set, inherits global.openbao.psql.sslMode, then global.psql.sslMode. When none are set, no SSL mode is passed and the driver default prefer applies.