Back to articles
Security & Anti-DDoS

Transition from HashiCorp Vault to OpenBao: Building Immutable Secrets Management on Enterprise CI/CD Clusters

Transitioning from HashiCorp Vault to OpenBao enables enterprises to build a flexible, secure, and third-party-independent secrets management system on CI/CD clusters. OpenBao...

DPTCloud Engineering4 min read
Transition from HashiCorp Vault to OpenBao: Building Immutable Secrets Management on Enterprise CI/CD Clusters

Transitioning from HashiCorp Vault to OpenBao enables enterprises to build a flexible, secure, and third-party-independent secrets management system on CI/CD clusters. OpenBao offers an open-source, self-managed solution deployable on internal infrastructure, integrating seamlessly with CI/CD tools such as Jenkins, GitLab CI, and ArgoCD. This guide outlines the migration process, including environment setup, secret synchronization, API configuration, and CI/CD pipeline integration, ensuring high consistency and security across the entire system.

Introduction to HashiCorp Vault and OpenBao

HashiCorp Vault is a widely used secrets management solution providing features such as encryption, storage, and distribution of keys, passwords, tokens, and certificates. However, reliance on cloud services or third-party infrastructure can introduce security and independence risks. OpenBao, an open-source project developed by HashiCorp, offers a self-managed version compatible with Vault but with greater flexibility for enterprises seeking full control over their infrastructure.

OpenBao supports similar capabilities to Vault, including secret storage, data encryption, user authentication, and access control. However, it is designed to operate within internal environments without requiring continuous cloud connectivity, making it ideal for organizations with high security requirements or those unwilling to depend on third parties.

Preparation and OpenBao Installation

To begin the migration, prepare a server or Kubernetes cluster for OpenBao deployment. The following steps outline the basic installation process:

sudo apt update
sudo apt install -y curl gnupg
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
sudo apt update
sudo apt install -y openbao

After installation, start the OpenBao service and verify its status:

sudo systemctl enable openbao
sudo systemctl start openbao
sudo systemctl status openbao

OpenBao can be configured to use storage backends such as PostgreSQL, MySQL, or Consul. Below is an example using PostgreSQL:

openbao init -backend=postgresql -config=/etc/openbao/config.hcl

Migrating Secrets from Vault to OpenBao

To migrate secrets from HashiCorp Vault to OpenBao, follow these synchronization steps:

  1. Create a backup from Vault using the vault read command or extract secrets via API.
  2. Convert data formats if necessary (e.g., from JSON to OpenBao format).
  3. Import data into OpenBao using the API or CLI interface.

Here is an example of using the API to import secrets:

curl -X POST -H "X-Vault-Token: $VAULT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"data": {"username": "admin", "password": "securepass"}}' \
  https://openbao.example.com/v1/secret/data/myapp

Ensure that access policies and roles in OpenBao are configured to match Vault’s to maintain consistent access control.

Integration with CI/CD and Validation

To integrate OpenBao into CI/CD pipelines, configure CI/CD tools to access OpenBao via API or SDK. Below is an example using GitLab CI:

variables:
  OPENBAO_ADDR: "https://openbao.example.com"
  OPENBAO_TOKEN: $OPENBAO_TOKEN

stages:
  - build
  - deploy

deploy_job:
  stage: deploy
  script:
    - curl -X GET -H "X-Vault-Token: $OPENBAO_TOKEN" $OPENBAO_ADDR/v1/secret/data/myapp
    - echo "Secrets retrieved successfully"

To validate functionality, perform the following checks:

  • Run openbao status to verify OpenBao’s operational state.
  • Access an imported secret to confirm successful connection and retrieval.
  • Execute the CI/CD pipeline to test secret access in a real environment.

Alternative Solutions and Future Guidance

OpenBao is a powerful choice for enterprises aiming for complete control over their secrets management system. However, if cloud-based solutions or enhanced features are required, consider alternatives such as HashiCorp Vault on internal infrastructure or other secrets management services like AWS Secrets Manager or Azure Key Vault.

For further exploration of network security and infrastructure solutions, refer to the following articles:

Related infrastructure & engineering guides: Cloud VPS with L3/L4/L7 Anycast Anti-DDoS

DPTCloud Tier III Infrastructure

Recommended NVMe Cloud VPS Plans to Deploy This Setup

Enterprise RAID 10 NVMe SSDs, CMC & FPT District 9 uplinks with Anycast Anti-DDoS and 99.99% SLA.

View 22 VPS Plans
ECO · vn-02

VPS-2E

94.600 ₫ / mo

10% VAT included

  • CPU: 2 vCPU
  • RAM: 2 GB
  • SSD: 30 GB NVMe
ECO · vn-02Recommended

VPS-3E

170.500 ₫ / mo

10% VAT included

  • CPU: 2 vCPU
  • RAM: 4 GB
  • SSD: 50 GB NVMe
BASIC · vn-01Recommended

VPS-05

457.600 ₫ / mo

10% VAT included

  • CPU: 4 vCPU
  • RAM: 8 GB
  • SSD: 50 GB NVMe

Related Articles

View all
ZaloZalo SupportDiscord0384 753 478