Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.
/ bws-env Public archive

Inject secrets into a command with Bitwarden Secrets Manager.

Notifications You must be signed in to change notification settings

tangowithfoxtrot/bws-env

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Important

A better version of this functionality is now included in the bws CLI. See: https://bitwarden.com/help/secrets-manager-cli/#run

bws-env

A wrapper script for bws, the Bitwarden Secrets Manager command-line utility, that injects secrets into a command.

Uses

Retrieve a secret from Bitwarden Secrets Manager

./bws-env.sh 'echo $SOME_VAR_FROM_BITWARDEN'

Note that we are using single-quotes to prevent the shell from expanding $SOME_VAR_FROM_BITWARDEN before bws-env.sh is called.

Inject secrets into a container

docker-compose.yml:

version: '3.3'
services:
  echo:
    image: alpine
    command: echo $SOME_VAR_FROM_BITWARDEN
./bws-env.sh 'docker-compose up -d'

Thanks

This script was made with Bashly.

Disclaimer

This script is not affiliated with Bitwarden or 8bit Solutions LLC. It is not an official Bitwarden product. Use at your own risk.