PHPackages                             itk-dev/vault-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. itk-dev/vault-bundle

ActiveSymfony-bundle[Security](/categories/security)

itk-dev/vault-bundle
====================

Symfony bundle for HashiCorp Vault

1.0.0(1mo ago)1978[1 PRs](https://github.com/itk-dev/vault-bundle/pulls)MITPHPPHP ^8.0

Since Oct 8Pushed 1mo ago3 watchersCompare

[ Source](https://github.com/itk-dev/vault-bundle)[ Packagist](https://packagist.org/packages/itk-dev/vault-bundle)[ RSS](/packages/itk-dev-vault-bundle/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (4)Dependencies (14)Versions (12)Used By (0)

Vault Bundle
============

[](#vault-bundle)

[![Github](https://camo.githubusercontent.com/c034dcd68f62cb64fe1751fd9dc3ea3d01a9e18a27ef61b68791ba79b2ca3a24/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f736f757263652d69746b2d2d6465762f7661756c742d2d62756e646c652d626c75653f7374796c653d666c61742d737175617265)](https://github.com/itk-dev/vault-bundle)[![Release](https://camo.githubusercontent.com/79a5a58b86e91039f552736cbf916caf3263826b3f4e7d84223527afccc09ec3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f69746b2d6465762f7661756c742d62756e646c652e7376673f7374796c653d666c61742d737175617265266c6162656c3d72656c65617365)](https://packagist.org/packages/itk-dev/vault-bundle)[![PHP Version](https://camo.githubusercontent.com/245a340607de0e967e9bb11fb683dbc5646f07cc563ea445297adf27fffded42/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f69746b2d6465762f7661756c742d62756e646c652e7376673f7374796c653d666c61742d73717561726526636f6c6f72423d253233383839324246)](https://www.php.net/downloads)[![Build Status](https://camo.githubusercontent.com/bd56c358e6966ce8b1340f3058dfa0f557d9b40c9dbf78b72b663caf83f0d1b7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f69746b2d6465762f7661756c742d62756e646c652f70722e79616d6c3f6c6162656c3d4349266c6f676f3d676974687562267374796c653d666c61742d737175617265)](https://github.com/itk-dev/vault-bundle/actions?query=workflow%3A%22Test+%26+Code+Style+Review%22)[![Read License](https://camo.githubusercontent.com/b2e7d31bb807d844be5c7a55bf7fbd858ec0fff205089277367a28bdc89c3a34/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f69746b2d6465762f7661756c742d62756e646c652e7376673f7374796c653d666c61742d73717561726526636f6c6f72423d6461726b6379616e)](https://github.com/itk-dev/vault-bundle/blob/master/LICENSE.md)[![Package downloads on Packagist](https://camo.githubusercontent.com/46df8aac1fec868ea0e686ef590718adaff54e6f1c5d1a74b71968fa1be4c8a3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f69746b2d6465762f7661756c742d62756e646c652e7376673f7374796c653d666c61742d73717561726526636f6c6f72423d6461726b6d6167656e7461)](https://packagist.org/packages/itk-dev/vault-bundle/stats)

This bundle enables Symfony sites to interact with HashiCorp Vault using the "approle" authentication method. It allows fetching secrets and provides the capability for local caching of both access tokens and the secrets themselves.

The bundle offers a services wrapper for the PHP library [itk-dev/vault-library](https://github.com/itk-dev/vault-library). Additionally, it includes an environment variable processor, enabling the retrieval of secrets directly in `.env` files at runtime.

Install
-------

[](#install)

```
composer require itk-dev/vault-bundle --no-scripts
```

Note

We use `--no-scripts` since the bundle config may not yet have been created.

### Setup

[](#setup)

Create a configuration file at `config/packages/itkdev_vault.yaml` and add the three referenced variables to `.env` with placeholder values. Then add the actual values to `.env.local`.

```
itkdev_vault:
  role_id: '%env(VAULT_ROLE_ID)%'
  secret_id: '%env(VAULT_SECRET_ID)%'
  url: '%env(VAULT_URL)%'
```

Usage
-----

[](#usage)

Use the service by simply injecting the service named `Vault` from the namespace `ItkDev\VaultBundle\Service`. Use the login function to fetch a token and then use the acquired token in the `getSecret` or `getSecrets` functions.

To use the environment variable processor, use the following format to specify what to retrieve from the vault:

```
MY_SECRET=::::
```

- **Path**: The secret engine path (e.g. prod, stg, test)
- **Secret**: Name of the secret in the engine (eg. itksites, dokk1)
- **Key**: The secret key that should be fetched (eg. OIDC, pretix-api-key)
- **Version**: Optional, fetch a specific version of the secret.
- **Expire**: Optional, the number of seconds to cache the secret.

When the variable have been defined, the next step is to activate the processor on the variable in `config/services.yaml` using the `vault` keyword.

```
parameters:
  $myOtherSecret: '%env(vault:MY_OTHER_SECRET)%'

App\Command\TestCommand:
  arguments:
    $secret: '%env(vault:MY_SECRET)%'
```

CLI support
-----------

[](#cli-support)

This bundle also comes with two CLI commands to help debug configuration and to check that you fetch the expected data from the vault. Use the `--help` option to Symfony console to see the options available for the commands.

- `itkdev:vault:login`
- `itkdev:vault:secret`

Developing
----------

[](#developing)

See details on contributing in the [contributing docs](/docs/CONTRIBUTING.md).

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance89

Actively maintained with recent releases

Popularity20

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 63.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~76 days

Recently: every ~132 days

Total

8

Last Release

55d ago

Major Versions

0.1.2 → 1.0.02026-03-25

PHP version history (2 changes)0.0.1PHP ^8.2

0.0.2PHP ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/33924554?v=4)[ITK Development](/maintainers/itk-dev)[@itk-dev](https://github.com/itk-dev)

---

Top Contributors

[![cableman](https://avatars.githubusercontent.com/u/111397?v=4)](https://github.com/cableman "cableman (43 commits)")[![turegjorup](https://avatars.githubusercontent.com/u/5631988?v=4)](https://github.com/turegjorup "turegjorup (15 commits)")[![rimi-itk](https://avatars.githubusercontent.com/u/11267554?v=4)](https://github.com/rimi-itk "rimi-itk (7 commits)")[![jekuaitk](https://avatars.githubusercontent.com/u/78410897?v=4)](https://github.com/jekuaitk "jekuaitk (3 commits)")

###  Code Quality

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/itk-dev-vault-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/itk-dev-vault-bundle/health.svg)](https://phpackages.com/packages/itk-dev-vault-bundle)
```

###  Alternatives

[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[pentatrion/vite-bundle

Vite integration for your Symfony app

2755.3M13](/packages/pentatrion-vite-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
