This repo is an implementation of the Docker compose deployment method for Bloodhound provided by SpectreOps.
- An Entra app registration, with the following permissions:
- Microsoft Graph:
Directory.Read.All - Entra:
Directory ReaderorGlobal Reader - Azure:
Reader(On all Subscriptions you wish to audit, or more easily the Root Management Group)
- Microsoft Graph:
- You will need to set the following environment variables in a
.envfile in this repo:AZURE_CLIENT_IDAZURE_CLIENT_SECRETAZURE_TENANT_IDBLOODHOUND_TOKEN_KEY(after initial setup, see below)BLOODHOUND_TOKEN_ID(after initial setup, see below)
- Docker or Docker Desktop
If you're in a corporate environment where a firewall is intercepting and resigning SSL/TLS requests, you'll need to add your custom CA certificate(s) to the Docker image:
-
Place your certificate file(s) (
.crtformat) in the repository directory -
Edit the
Dockerfileand uncomment the certificate lines (around line 17-20):# COPY <certfile> /usr/local/share/ca-certificates/ # RUN update-ca-certificates
-
Replace
<certfile>with your certificate filename(s). For multiple certificates:COPY cert1.crt cert2.crt /usr/local/share/ca-certificates/ RUN update-ca-certificates
-
Rebuild the image and recreate the container:
docker compose up -d --build azurehound
This will rebuild the image with your certificates and recreate the container.
-
Clone this repo
-
Copy the example environment file and configure it:
cp .env.example .env
-
Edit
.envand add your Azure/Entra credentials:AZURE_CLIENT_IDAZURE_CLIENT_SECRETAZURE_TENANT_ID
-
Execute
docker compose up -dto start the Bloodhound services (app-db, graph-db, and bloodhound - azurehound will fail that is OK) -
Access the bloodhound instance at
http://localhost:8080/ui/login -
Login as
admin, the default password can be found inbloodhound.config.json -
Create a new user (optional) and generate an API key and ID, see: Create a non-personal API key/ID pair.
-
Add/Update the following environment variables to your
.envfile:BLOODHOUND_TOKEN_KEY(the API key you generated)BLOODHOUND_TOKEN_ID(the API ID you generated)
-
Execute
docker compose up -d --force-recreate azurehound -
The
azurehoundcontainer will automatically run and:- Collect data from the target Entra and Azure environment
- Generate an
output.jsonfile with the collected data - Upload the data to the Bloodhound instance via the API
- Exit after completion (this is expected behavior)
Tip
You can start the azurehound container to refetch data from Entra and Azure
on demand
While using your instance, you may wish to update your data set in the underlying neo4j database.
To refresh the data with current information from Azure/Entra:
- Execute
docker compose up azurehoundto re-run the azurehound container - The container will collect fresh data and upload it to Bloodhound
Important
This will add to the existing data set rather than replacing it. This can result in duplicate data - you way wish to instead wipe the data and refresh it. See the next section.
To completely wipe the neo4j database and start fresh:
docker compose stop graph-db
docker volume rm bloodhound_neo4j-data
docker compose up -d graph-dbdocker compose down --volumes
docker compose up -dAfter wiping the database, run the azurehound container to populate it with fresh data:
docker compose up azurehoundTip
Option 1 is recommended as it only affects the neo4j database, keeping your Bloodhound configuration and postgres data intact. Option 2 will reset everything including user accounts and settings.