Vault Rails banner
hashicorp hashicorp

Vault Rails

Development community

Description

A Rails plugin for easily integrating Vault secrets

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

Vault Rails [![Build Status](https://github.com/hashicorp/vault-rails/actions/workflows/run-tests.yml/badge.svg?branch=main)](https://github.com/hashicorp/vault-rails/actions/workflows/run-tests.yml)

Vault is the official Rails plugin for interacting with [Vault](https://vaultproject.io) by HashiCorp.

**If you're viewing this README from GitHub on the `master` branch, know that it may contain unreleased features or different APIs than the most recently released version. Please see the Git tag that corresponds to your version of the Vault Rails plugin for the proper documentation.**

Requirements

  • Ruby 3.2+
  • Rails 7.0+
  • Vault 1.16+ (LTS and current releases supported)

Table of Contents

  1. Quick Start
  2. Advanced Configuration
  3. Caveats
  4. Development

Quick Start

↥ [back to top](#table-of-contents)

  1. Add to your Gemfile:

    gem "vault-rails", require: false

    and then run the `bundle` command to install.

  2. Create an initializer:

    require "vault/rails"
    
    Vault::Rails.configure do |vault|
      # Use Vault in transit mode for encrypting and decrypting data. If
      # disabled, vault-rails will encrypt data in-memory using a similar
      # algorithm to Vault. The in-memory store uses a predictable encryption
      # which is great for development and test, but should _never_ be used in
      # production. Default: ENV["VAULT_RAILS_ENABLED"].
      vault.enabled = Rails.env.production?
    
      # The name of the application. All encrypted keys in Vault will be
      # prefixed with this application name. If you change the name of the
      # application, you will need to migrate the encrypted data to the new
      # key namespace. Default: ENV["VAULT_RAILS_APPLICATION"].
      vault.application = "my_app"
    
      # The address of the Vault server. Default: ENV["VAULT_ADDR"].
      vault.address = "https://vault.corp"