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
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.
# 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: trueIn GitLab, on the top bar, select Search or go to and find your project.
Select Settings > General.
Expand Visibility, project features, permissions.
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:
umask 077
kubectl --namespace <namespace> get secret <release>-openbao-unseal -o jsonpath='{.data}' > openbao-unseal-backup.jsonStore 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:
Note the current replica count so you can restore it afterward.
Scale down OpenBao so the running pod does not race the
DROP TABLEandCREATE TABLEstatements in the dump: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:
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.
| Parameter | Default | Description |
|---|---|---|
config.logLevel | info | OpenBao log level. |
config.logRequestsLevel | off | OpenBao request log level. To enable request logging set this to the same value as config.logLevel or a higher level. |
config.logFormat | json | OpenBao log format. Either json or standard. |
nameOverride | Override the chart name. | |
fullnameOverride | Override the fully qualified app name. | |
serviceAccount.create | true | Create a service account for OpenBao. |
serviceAccount.automount | true | |
serviceAccount.annotations | {} | Additional service account annotations. |
serviceAccount.name | Override the generated service account name. | |
role.create | Create a role with necessary RBAC permissions. | |
securityContext.capabilities | { drop: ["ALL"] } | |
securityContext.runAsNonRoot | true | |
securityContext.allowPrivilegeEscalation | false | |
securityContext.runAsUser | 1000 | |
podSecurityContext.seccompProfile | RuntimeDefault | |
podSecurityContext.runAsUser | 1000 | |
podSecurityContext.fsGroup | 1000 | |
serviceActive.type | ClusterIP | Service type of the active OpenBao pod. |
serviceActive.annotations | {} | Service annotations of the active OpenBao pod. |
serviceInactive.type | ClusterIP | Service type of the standby OpenBao pods. |
serviceInactive.annotations | {} | Service annotations of the standby OpenBao pods. |
resources | {} | Resource limits and requests. |
autoscaling.minReplicas | 2 | Minimum OpenBao replicas. |
autoscaling.maxReplicas | 2 | Maximum OpenBao replicas. |
autoscaling.targetCPUUtilizationPercentage | 80 | Target CPU utilization for autoscaling. |
autoscaling.targetMemoryUtilizationPercentage | Target memory utilization for autoscaling. | |
livenessProbe | OpenBao liveness probe. Check OpenBao values for the default. | |
readinessProbe | OpenBao 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. |
extraVolumes | Additional volumes for the OpenBao pods. | |
extraVolumeMounts | Additional volume mounts for the OpenBao container. | |
config.ui | false | Enable the OpenBao UI. |
config.clusterPort | 8201 | OpenBao cluster port. |
config.apiPort | 8200 | OpenBao API port. |
config.cacheSize | 2560 | Size of the read cache used by the physical storage subsystem as a number of entries. |
config.maxRequestSize | 786432 | Maximum request size in bytes. Default is 768KB. |
config.maxRequestJsonMemory | 1048576 | Maximum 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.
| Parameter | Default | Description |
|---|---|---|
image.repository | registry.gitlab.com/gitlab-org/build/cng/gitlab-openbao | Repository of the OpenBao image. |
image.pullPolicy | IfNotPresent | Image pull policy. |
image.tag | Override 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.
| Parameter | Default | Description |
|---|---|---|
global.openbao.host | openbao.<GitLab Domain> | OpenBao host. Used to configure GitLab webservice and the OpenBao chart. |
global.openbao.url | Derived from host | OpenBao URL for GitLab. If present, must be a complete URI. |
global.openbao.jwt_audience | Same as url | JWT 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.enabled | true | Enable the OpenBao Ingress to allow Runner to reach OpenBao. |
ingress.hostname | External OpenBao host based on global hosts config. | Hostname the Ingress should match. |
ingress.tls.enabled | true | Enable Ingress TLS. |
ingress.tls.secretName | Name of the Kubernetes TLS Secret. Managed by certmanager by default. | |
tlsSecretName | Name of the TLS secret mounted internally. Defaults to the Ingress TLS secret. | |
ingress.annotations | true | Annotations rendered to the Ingress. Use this to configure OpenBao for any non-NGINX Ingress controllers. |
ingress.configureCertmanager | Global certmanager config | Use certmanager to manage the TLS certificate. |
ingress.certmanagerIssuer | <release>-issuer | Name of the certmanager issuer. |
ingress.sslPassthroughNginx | false | Annotate the Ingress to pass through incoming TLS connections to OpenBao. If certmanager is configured, new HTTP01 challanges will be through another Ingress. |
config.tlsDisable | true | Disable internal TLS. If disabled, Ingress TLS passthrough is also disabled. |
config.metricsListener.tlsDisable | true | Disable 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:
global:
ingress:
useNewIngressForCerts: true
config:
tlsDisable: false
ingress:
sslPassthroughNginx: trueEnabling 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.
| Parameter | Default | Description |
|---|---|---|
gatewayRoute.enabled | Defaults to value of global.gatewayApi.enabled | Enable exposing OpenBao via a HTTPRoute. |
gatewayRoute.sectionName | openbao-web | Gateway section to be used by the HTTPRoute. |
gatewayRoute.gatewayName | GitLab chart managed Gateway | Gateway 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.
| Parameter | Default | Description |
|---|---|---|
config.telemetry.enabled | true | Enable telemetry and monitoring. |
config.telemetry.disableHostname | true | Prefix gauge values with local hostname. |
config.telemetry.prometheusRetentionTime | 24h | Metrics retention time. |
config.telemetry.metricsPrefix | openbao | Prefix for all metrics. |
config.telemetry.usageGaugePeriod | 0 | Interval at which high-cardinality usage data is collected, such as token counts, entity counts, and secret counts. |
config.telemetry.numLeaseMetricsBuckets | 1 | Number of expiry buckets for leases. |
config.telemetry.prefixFilter | Metric prefixes to include (+) or exclude (-) from telemetry. Check OpenBao values for the default. | |
config.metricsListener.enabled | true | Enable 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.tlsDisable | true | Disable internal TLS of the metrics listener. |
config.metricsListener.port | 8209 | Port of the metrics listener. |
config.metricsListener.unauthenticatedMetricsAccess | true | Allow requests for metrics to be served without authentication. |
podMonitor.enabled | false | Enable 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:
staticauto unsealing (default)- AWS KMS unsealing
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.
| Parameter | Default | Description |
|---|---|---|
global.openbao.unseal.currentKeyField | key | Field of the unseal secret holding the current key. |
global.openbao.unseal.previousKeyField | Field 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.enabled | true | Enable static auto unsealing. |
config.unseal.static.currentKeyId | gl-unseal-1 | ID of the current static unsealing key. |
config.unseal.static.currentKey | /srv/openbao/keys/gl-unseal-1 | Path of the current static unsealing key. |
config.unseal.static.previousKeyId | ID of the previous static unsealing key, used to rotate the key. Set with previousKey, or leave both empty. | |
config.unseal.static.previousKey | Path of the previous static unsealing key. Set with previousKeyId, or leave both empty. Setting one alone stops the chart from rendering. | |
config.unseal.awskms.enabled | false | Enable AWS KMS auto-unsealing. |
config.unseal.awskms.kmsKeyId | KMS key ID, ARN, or alias (for example, alias/my-openbao-key). Required when config.unseal.awskms.enabled is true. | |
config.unseal.awskms.region | AWS region where the KMS key resides. | |
config.unseal.awskms.endpoint | Optional custom KMS endpoint URL (for example, a VPC endpoint). | |
config.initialize.enabled | true | Enable OpenBao self initialization. |
config.initialize.oidcDiscoveryUrl | External GitLab host | OIDC discovery URL. Defaults to the external GitLab hostname. |
config.initialize.boundIssuer | External GitLab host | Issuer URL. Defaults to the external GitLab hostname. |
config.initialize.boundAudiences | External OpenBao host | OIDC role audiences. Defaults to the external OpenBao hostname. |
staticUnsealSecret.generate | false | Generate a static key to auto unseal OpenBao. Defaults to false as managed by GitLab charts shared-secret chart. |
initializeTpl | Template 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.currentKeyFieldnames the field holding the current key.global.openbao.unseal.previousKeyFieldnames 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-unsealsecret and a backed up OpenBao database.
To rotate the static unseal key:
Generate a new key. Use 32 raw bytes, not base64 text. Set a restrictive
umaskfirst, becauseopensslapplies your shell’s currentumaskto the new file:umask 077 openssl rand -out newkey 32Add 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: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.jsonPoint 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
currentKeyFieldorpreviousKeyField. If you name a field the secret does not have, the pods fail to start and log anis a directoryerror for that key path.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"previousKeyFieldis whatevercurrentKeyFieldwas before this change. On a chart that has never rotated, that iskey.The upgrade restarts the OpenBao pods. The OpenBao
Deploymentuses theRecreatestrategy, 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.Confirm the re-encryption performed by the active pod (labeled
openbao-active=true). Its logs must show bothupgrading stored keysandupgrading recovery key, and nopost-unseal upgrade seal keys failederror: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
failedline, or eitherupgradingline 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. Theno recovery key founderror 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
failedline 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.
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, andpreviousKeyFieldfrom your values and runhelm upgrade:helm upgrade --install <release> gitlab/gitlab --namespace <namespace> -f <values>.yamlWait 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 whateverpreviousKeyFieldnamed. If you delete the field before the new pods are ready, a pod that restarts on the old configuration fails to start:kubectl --namespace <namespace> patch secret <release>-openbao-unseal --type=json \ -p '[{"op":"remove","path":"/data/key"}]'Delete the temporary key file:
rm -f newkeyYour 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:
- Generate one new key using the process in the main procedure. Use the same key on every site.
- On every secondary site, add the new key to the unseal secret and run
helm upgradewith the same values as the primary site:currentKeyField,previousKeyField,currentKeyId,currentKey,previousKeyId, andpreviousKey. - Rotate the primary site with the main procedure, up to and including confirming the re-encryption.
- 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.
- 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:
- Restore the values you had before the rotation.
- Run
helm upgradeand wait for the pods to be ready. - 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:
- Make the old key current again and the new key previous. Swap
currentKeyFieldandpreviousKeyField, and swap the IDs and paths with them. - Run
helm upgradeand wait for the pods to be ready. - Confirm the re-encryption back to the old key, with the same log check.
- 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:
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:
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.kmsKeyIdto the new key,helm upgraderestarts 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:
kubectl --namespace <namespace> rollout restart deployment -l app.kubernetes.io/name=openbao,app.kubernetes.io/instance=<release>
Confirm the active pod re-encrypted its root key, using the log check in Rotate the static unseal key.
On a Geo deployment, wait for the OpenBao database to replicate to every secondary site.
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.
| Parameter | Default | Description |
|---|---|---|
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.hopSkips | 0 | Number of trusted proxy addresses to skip, counting from the end of the header. OpenBao uses the next address as the client address. |
config.xForwardedFor.rejectNotPresent | false | Reject requests that have no X-Forwarded-For header. Keep this false, because Kubernetes probes send requests without the header. |
config.xForwardedFor.rejectNotAuthorized | false | Reject 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)'.
openbao:
config:
xForwardedFor:
authorizedAddrs:
- 10.0.0.0/16On the command line, pass the list in braces:
--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 OpenBao | hopSkips |
|---|---|
| Layer 4 load balancer → NGINX or Envoy Gateway | 0 |
| Layer 7 load balancer → Envoy Gateway | 1 |
Layer 7 load balancer → NGINX with use-forwarded-headers: "true" and compute-full-forwarded-for: "true" in nginx-ingress.controller.config | 1 |
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.
| Parameter | Default | Description |
|---|---|---|
global.openbao.httpAudit.secret | <release>-openbao-audit-secret | Name of the secret storing the token shared between OpenBao and GitLab. |
global.openbao.httpAudit.key | token | Secret key storing the shared token. |
config.audit.http.enabled | true | Enable streaming of auditing events by using HTTP to GitLab. |
config.audit.http.streamingUri | Internal workhorse URL | Endpoint to stream auditing events to. |
config.audit.http.authTokenPath | /srv/openbao/audit/gitlab-auth | Path the token shared with GitLab is mounted at. |
config.audit.http.requestTimeout | Go duration string (for example, 5s) that bounds each audit-event HTTP POST to the streaming endpoint. Empty, the default, means no timeout. | |
auditTpl | Template that configures the OpenBao audit devices. Check OpenBao values for the default. | |
httpAuditSecret.generate | false | Generate a secret to be shared with GitLab for authenticated auditing. Defaults to false as managed by GitLab charts shared-secret chart. |
initializeTpl | Template 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:
- First set
requestTimeoutto empty. - 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:
Create a PostgreSQL user and database on your database server:
-- Create the OpenBao user CREATE USER openbao WITH PASSWORD '<password>'; -- Create the OpenBao database CREATE DATABASE openbao OWNER openbao;Create a Kubernetes secret containing the password:
kubectl create secret -n bao generic openbao-db-password --from-literal=password="<password>"Configure OpenBao to connect to your external database:
global: openbao: psql: host: "psql.openbao.example.com" port: 5432 database: openbao username: openbao password: secret: openbao-db-password key: passwordThis 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 assslMode,connectTimeout, or keepalive tuning), useopenbao.config.storage.postgresql.connectionalongside the global settings.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.
| Parameter | Default | Description |
|---|---|---|
config.storage.postgresql.haEnabled | true | Enable high availability mode for PostgreSQL storage. |
config.storage.postgresql.haTable | null | Table used for high availability locks. Uses the OpenBao default when unset. |
config.storage.postgresql.maxConnectRetries | 20 | Maximum number of database connection retry attempts. |
config.storage.postgresql.maxIdleConnections | 2 | Maximum number of idle database connections. |
config.storage.postgresql.maxParallel | 5 | Maximum number of parallel database operations. |
config.storage.postgresql.skipCreateTable | null | Skip automatic creation of the storage tables. Create them manually when set to true. |
config.storage.postgresql.connection.keepalives | null | Enable TCP keepalive probes. Set to 1 to enable or 0 to disable. |
config.storage.postgresql.connection.keepalivesCount | null | Number of TCP keepalive probes to send before dropping a connection. |
config.storage.postgresql.connection.keepalivesIdle | null | Seconds of inactivity before the first TCP keepalive probe. |
config.storage.postgresql.connection.keepalivesInterval | null | Seconds between TCP keepalive probes. |
config.storage.postgresql.connection.sslMode | null | PostgreSQL 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. |