Overview
Pwnbook integrates with Bitwarden Secrets Manager so your team can store sensitive credentials — API tokens, passwords, private keys — in Bitwarden’s vault and reference them inside Pwnbook using a simple template syntax:{{bw.*}} reference instead of pasting a raw secret. Pwnbook resolves the value at runtime by calling the Bitwarden Secrets Manager API.
Why this matters:
- Secrets never live in Pwnbook’s database — only the reference does
- Revoke the machine account token in Bitwarden and Pwnbook immediately loses access to all secrets
- Rotate individual secrets in Bitwarden without reconfiguring anything in Pwnbook
- Audit secret access in Bitwarden’s event log
Prerequisites
- A Bitwarden account with Secrets Manager enabled (Teams or Enterprise plan)
- Permission to create machine accounts and projects in your Bitwarden organization
- Admin or Owner access in Pwnbook to configure the integration
Concepts
Secrets Manager vs Password Manager
Secrets Manager vs Password Manager
Bitwarden offers two products. This integration uses Secrets Manager — the developer-focused secrets API designed for machine-to-machine access. It is separate from the Password Manager vault your team uses for logins.
Machine accounts
Machine accounts
A machine account is a non-human Bitwarden identity that holds an access token. You create one specifically for Pwnbook, grant it access to the secrets Pwnbook needs, and give the token to Pwnbook. Revoking the machine account immediately cuts off Pwnbook’s access.
Projects
Projects
In Bitwarden Secrets Manager, secrets are organized into projects. You can give Pwnbook access to a dedicated project (e.g.,
pwnbook-integrations) so it can only read the secrets you explicitly put there — not everything in your org.Setup
Enable Secrets Manager in Bitwarden
If you haven’t already, enable Secrets Manager for your Bitwarden organization:
- Log in to the Bitwarden web app.
- Go to your Organization → Settings → Subscription.
- Enable Secrets Manager.
Create a project for Pwnbook secrets
- In the Bitwarden web app, switch to Secrets Manager (toggle in the left sidebar).
- Go to Projects → New Project.
- Name it something clear, like
pwnbook-integrations. - Click Save.
Add your secrets to the project
For each credential you want to use in Pwnbook, create a secret in the project:
- Go to Secrets → New Secret.
- Set a Name — this is the key you’ll use in
{{bw.name}}references. Use lowercase with underscores (e.g.,semgrep_api_token,checkmarx_api_key). - Set the Value — the actual credential.
- Assign it to your
pwnbook-integrationsproject. - Click Save.
Secret names are case-sensitive in
{{bw.*}} references. {{bw.Semgrep_Token}} and {{bw.semgrep_token}} resolve to different secrets.Create a machine account for Pwnbook
- In Secrets Manager, go to Machine Accounts → New Machine Account.
- Name it
pwnbook(orpwnbook-<your-env>if you run multiple environments). - Click Save.
- On the machine account page, go to Access Tokens → Generate Token.
- Give the token a name and set an expiry (or leave it non-expiring — your choice).
- Copy the token value. This is the only time it will be shown.
Grant the machine account access to your project
- Go to Projects → pwnbook-integrations → Access.
- Click Grant Access.
- Select your
pwnbookmachine account. - Set the permission to Read (Pwnbook only needs to read secrets, not create or modify them).
- Click Save.
Connect Bitwarden to Pwnbook
- In Pwnbook, go to Organization Settings → Marketplace → Bitwarden Secrets Manager.
- Click Configure.
- Enter the Access Token you generated in the previous step.
- Click Save & Test to verify Pwnbook can authenticate and list accessible secrets.
{{bw.*}} references will start resolving.Using {{bw.*}} references
Once connected, you can use {{bw.secret_name}} anywhere Pwnbook accepts a credential or configuration value.
In integration settings
When configuring an integration (e.g., Semgrep, Checkmarx, Snyk), instead of pasting an API token directly into the field, enter a Bitwarden reference:In API request headers
When building API requests in the API Testing module, use{{bw.*}} references in headers, query parameters, or request bodies:
In script templates and packet templates
Reference secrets in community scripts and packet templates to avoid hardcoding credentials in shared scripts:How secret resolution works
When Pwnbook encounters a{{bw.secret_name}} reference, it:
- Calls the Bitwarden Secrets Manager API using the stored machine account token.
- Looks up the secret by name within the projects the machine account has access to.
- Substitutes the resolved value in-memory for that request.
- The resolved value is never logged or persisted — only the
{{bw.secret_name}}reference is stored.
Revoking access
To immediately cut off Pwnbook’s access to all Bitwarden secrets:- In Bitwarden Secrets Manager, go to Machine Accounts → pwnbook.
- Click on the access token.
- Click Revoke.
{{bw.*}} references in Pwnbook will stop resolving until you provide a new token.
To rotate the token without downtime:
- Generate a new token on the same machine account.
- Update the token in Pwnbook → Organization Settings → Marketplace → Bitwarden.
- Revoke the old token.
Disconnecting
To remove the Bitwarden integration from Pwnbook:- Go to Organization Settings → Marketplace → Bitwarden Secrets Manager.
- Click Disconnect.
{{bw.*}} references. Any integration fields or API requests using references will fail until you either reconnect or replace the references with raw values.
Disconnecting does not delete secrets from your Bitwarden vault. It only removes the token from Pwnbook.