tutorial

Bitwarden CLI Monitoring with Vigilmon

"Learn how to monitor Bitwarden CLI and Secrets Manager integrations with Vigilmon — covering secret retrieval health checks, vault availability monitoring, session heartbeats for automated workflows, and alerting for DevOps secret pipelines."

Bitwarden CLI Monitoring with Vigilmon

Bitwarden is the leading open-source password manager, and its CLI (bw) and Secrets Manager SDK extend it into developer and DevOps workflows. Teams use the Bitwarden CLI to inject secrets into CI/CD pipelines, automate credential rotation, populate environment files from the vault, and run scripts that authenticate against external APIs using credentials stored centrally in Bitwarden.

These automated workflows depend on Bitwarden's availability, your vault being accessible, and the CLI producing valid output. When they fail — due to a vault outage, an expired API key, a rotated organization key, or a misconfigured CI environment — the failure is often silent: a script exits with an empty variable, a deployment proceeds with a missing credential, or a rotation job silently skips its payload.

This guide covers how to monitor Bitwarden CLI integrations using Vigilmon.


Why Bitwarden CLI Workflows Need Monitoring

Bitwarden CLI automation fails in several common ways:

  • Vault service unavailabilitybw.bitwarden.com or a self-hosted Vaultwarden instance goes down; CLI commands time out or return errors
  • Session token expirybw unlock sessions expire; automated scripts that do not handle re-authentication start returning empty secrets
  • API key rotation — a service account's client secret is rotated but the CI variable holding the old secret is not updated
  • Secrets Manager project unavailability — a Bitwarden Secrets Manager project is archived or permissions are changed; automated retrievals return errors
  • Rate limiting — high-frequency secret retrieval triggers Bitwarden's rate limits, causing intermittent failures across services
  • Self-hosted Vaultwarden outages — teams running their own Vaultwarden instance need external monitoring of that service

Vigilmon monitors these failure modes through HTTP checks against Bitwarden's status endpoints and heartbeats from your automation scripts.


Monitoring Bitwarden Service Availability

Monitor 1: Bitwarden Status API

Bitwarden provides a public status page and API:

  1. Log in to VigilmonMonitors → New Monitor
  2. Type: HTTP
  3. Name: Bitwarden Cloud Status
  4. URL: https://status.bitwarden.com/api/v2/status.json
  5. Method: GET
  6. Expected status: 200
  7. Keyword check: "indicator":"none" (Bitwarden's "all systems operational" indicator)
  8. Interval: 5 minutes

This gives you a Vigilmon-native alert the moment Bitwarden has a reported incident, without relying on their email subscribers list.

Monitor 2: Bitwarden API Endpoint Direct Check

For more precise detection, monitor the Bitwarden API endpoint that your CLI calls:

  1. Type: HTTP
  2. Name: Bitwarden API - Identity Server
  3. URL: https://identity.bitwarden.com/connect/token
  4. Method: POST
  5. Expected status: 400 (a 400 with a JSON body means the server is up; a 5xx or timeout means it is down)
  6. Interval: 2 minutes

A 400 is expected when posting without credentials — it proves the identity server is accepting requests.


Monitoring Self-Hosted Vaultwarden

Teams running Vaultwarden self-hosted need external uptime monitoring:

# docker-compose.yml excerpt
services:
  vaultwarden:
    image: vaultwarden/server:latest
    environment:
      WEBSOCKET_ENABLED: "true"
      SIGNUPS_ALLOWED: "false"
    ports:
      - "80:80"
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost/alive"]
      interval: 30s
      timeout: 5s
      retries: 3

In Vigilmon:

  1. Type: HTTP
  2. Name: Vaultwarden - Self-hosted
  3. URL: https://vault.your-domain.com/alive
  4. Interval: 1 minute
  5. Expected status: 200

Monitoring CLI Automation Workflows

Pattern 1: Secret Retrieval Heartbeat

For scripts that use bw to pull secrets at runtime, add a heartbeat on success:

#!/bin/bash
# inject-secrets.sh
set -euo pipefail

# Authenticate with service account
export BW_SESSION=$(bw login --apikey --raw)

# Retrieve a required secret
DB_PASSWORD=$(bw get password "production/postgres" --session "$BW_SESSION")

if [ -z "$DB_PASSWORD" ]; then
  echo "[bitwarden] ERROR: failed to retrieve database password"
  exit 1
fi

# Use the secret...
export DATABASE_URL="postgres://app:${DB_PASSWORD}@db.your-domain.com/prod"

# Signal success
curl -s "https://heartbeat.vigilmon.online/$VIGILMON_SECRET_RETRIEVAL_HEARTBEAT_ID"

bw logout > /dev/null 2>&1

In Vigilmon:

  • Type: Heartbeat
  • Name: Bitwarden - Secret Retrieval Pipeline
  • Expected interval: Matches your script's run frequency
  • Grace period: 15 minutes

Pattern 2: Bitwarden Secrets Manager Retrieval

For teams using Bitwarden Secrets Manager (BWS) via the bws CLI:

#!/bin/bash
# bws-health-check.sh
set -euo pipefail

# Use a dedicated health-check secret (not a production secret)
HEALTH_VALUE=$(bws secret get "$BWS_HEALTH_SECRET_ID" \
  --access-token "$BWS_ACCESS_TOKEN" \
  --output json 2>/dev/null | jq -r '.value')

if [ "$HEALTH_VALUE" != "ok" ]; then
  echo "[bws] health secret retrieval failed or returned unexpected value"
  exit 1
fi

echo "[bws] Secrets Manager is reachable and returning correct values"
curl -s "https://heartbeat.vigilmon.online/$VIGILMON_BWS_HEARTBEAT_ID"

Create a dedicated "health check" secret in your BWS project with the value ok. This tests the full retrieval path — authentication, authorization, and value decryption — without exposing any real credentials.

Pattern 3: CI/CD Pipeline Secret Injection

# .github/workflows/deploy.yml
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Install Bitwarden CLI
        run: npm install -g @bitwarden/cli

      - name: Retrieve secrets
        env:
          BW_CLIENTID: ${{ secrets.BW_CLIENTID }}
          BW_CLIENTSECRET: ${{ secrets.BW_CLIENTSECRET }}
          BW_PASSWORD: ${{ secrets.BW_PASSWORD }}
        run: |
          export BW_SESSION=$(bw login --apikey --raw)
          echo "API_KEY=$(bw get password 'production/api-key')" >> $GITHUB_ENV
          bw logout

      - name: Signal secret retrieval health
        if: success()
        run: |
          curl -s "https://heartbeat.vigilmon.online/${{ secrets.VIGILMON_HEARTBEAT_ID }}"

      - name: Deploy
        run: ./deploy.sh

API Key Rotation Monitoring

When Bitwarden service account API keys are rotated, all consumers must be updated. Monitor the rotation cadence with a heartbeat:

#!/bin/bash
# post-rotation-verify.sh — run after every key rotation
set -euo pipefail

# Test authentication with the new key
NEW_SESSION=$(bw login \
  --apikey \
  --clientid "$NEW_BW_CLIENTID" \
  --clientsecret "$NEW_BW_CLIENTSECRET" \
  --raw 2>/dev/null)

if [ -z "$NEW_SESSION" ]; then
  echo "[rotation] new API key authentication failed"
  exit 1
fi

echo "[rotation] new API key verified"
curl -s "https://heartbeat.vigilmon.online/$VIGILMON_KEY_ROTATION_HEARTBEAT_ID"

bw logout --session "$NEW_SESSION" > /dev/null

In Vigilmon:

  • Type: Heartbeat
  • Name: Bitwarden - API Key Rotation Verification
  • Expected interval: Your key rotation policy period (e.g., 90 days)
  • Grace period: 24 hours

Alert Configuration

| Monitor | Type | Interval | Alert Channel | |---------|------|----------|---------------| | Bitwarden Cloud Status | HTTP | 5 min | Slack | | Bitwarden API endpoint | HTTP | 2 min | PagerDuty + Slack | | Vaultwarden self-hosted | HTTP | 1 min | PagerDuty | | Secret retrieval pipeline | Heartbeat | Varies | Slack | | BWS Secrets Manager | Heartbeat | 30 min | Slack | | API key rotation | Heartbeat | 90 days | Email + Slack |

Configure in Vigilmon under Settings → Notifications. Route Vaultwarden and API endpoint failures to PagerDuty since these block all secret retrieval.


Monitoring the Bitwarden Secrets Manager SDK

For teams using BWS in application code via the SDK:

# health_check.py
import os
import sys
from bitwarden_sdk import BitwardenClient, DeviceType, client_settings_from_dict

def check_bws_health():
    client = BitwardenClient(
        client_settings_from_dict({
            "apiUrl": os.environ.get("BWS_API_URL", "https://api.bitwarden.com"),
            "identityUrl": os.environ.get("BWS_IDENTITY_URL", "https://identity.bitwarden.com"),
            "userAgent": "health-check/1.0",
            "deviceType": DeviceType.SDK,
        })
    )

    client.auth().login_access_token(os.environ["BWS_ACCESS_TOKEN"])

    secret = client.secrets().get(os.environ["BWS_HEALTH_SECRET_ID"])
    if secret.data.value != "ok":
        print(f"[bws] unexpected health secret value: {secret.data.value}")
        sys.exit(1)

    print("[bws] SDK health check passed")
    return True

if __name__ == "__main__":
    if check_bws_health():
        import urllib.request
        urllib.request.urlopen(os.environ["VIGILMON_HEARTBEAT_URL"])

Run this as a Kubernetes CronJob or a scheduled GitHub Actions workflow.


Status Page for Secret Management Infrastructure

Create a Vigilmon status page for your secrets infrastructure:

  1. Status Pages → New Page → name it "Secrets & Credentials Infrastructure"
  2. Add monitors: Bitwarden Cloud, Vaultwarden, Secret Retrieval Pipeline, BWS Secrets Manager
  3. Share with platform and security teams

During incidents, this page shows whether a deployment failure is caused by a Bitwarden outage or a local configuration issue.


Summary

Bitwarden CLI and Secrets Manager automate the critical flow of credentials into your applications and pipelines. Vigilmon provides:

  • HTTP monitors for Bitwarden Cloud service availability and self-hosted Vaultwarden uptime
  • Heartbeat monitors for secret retrieval pipelines, CI/CD injection, and key rotation verification
  • Alert routing for immediate notification when secret access fails
  • Status pages for organization-wide secrets infrastructure visibility

Get started at vigilmon.online.

Monitor your app with Vigilmon

Free plan — 5 monitors, no credit card required. Up and running in 60 seconds.

Start free →