- Switch between PostgreSQL and Neo4j backends
- Run multiple BHCE instances on a single machine
Prerequisites
BloodHound CE deploys in a traditional multi-tier container architecture consisting of database, application, and UI layers. To complete installation, ensure your system meets the following requirements:bloodhound container to terminate with exit code 137 (out of memory).To avoid this behavior, allocate at least 8GB of RAM or wait for startup processing to complete before running API automation tasks such as user creation.Install with Docker Compose
This installation method provides more control over each configuration file and works well for running multiple BHCE instances on a single machine.Install Docker Desktop
Create installation directory
Download configuration files
Add configuration files
Start BloodHound
up or down if you prefer.Build from source
You can also build the BHCE code from source if you plan on contributing to the project or customizing the application beyond what is possible with configuration files.Prerequisite
The following table lists the minimum requirements to build BHCE from source:Set up your environment
The code repository contains all the necessary files to build BHCE. Follow these steps to set up your development environment:Clone the repository
Start Docker Desktop
Navigate to repository directory
Install dependencies
Start development environment
Compile BHCE
stbernard for building and testing the project.To build locally, run the following command:dist/ directory.Customizations
This section describes common customizations you can make to your BHCE installation.Change backend database
PostgreSQL provides significant advantages over Neo4j as a backend database, particularly in terms of query performance and speed.PostgreSQL
If you are currently using a Neo4j backend database and want to change to PostgreSQL, follow these steps.Add the PostgreSQL graph driver
bloodhound.config.json file and add a line in the main section to use PostgreSQL as the graph driver:default_password and log_level, but it can be anywhere at the top level.Remove the Neo4j service
docker-compose.yml file to remove the Neo4j service and its dependencies.-
Delete the
graph_dbsection: -
Delete the two lines at the end of the
bloodhoundsection: -
Delete the following line from the
volumessection:The following is the complete modifieddocker-compose.ymlfile for PostgreSQL:
Neo4j
If you are currently using a PostgreSQL backend database and want to change to Neo4j, follow these steps.Add the Neo4j service
docker-compose.yml file with the following:Remove the PostgreSQL graph driver
bloodhound.config.json file:Enable Transport Layer Security (TLS)
To secure BHCE with HTTPS, add your certificate information to thetls block in the bloodhound.config.json file and make the certificate files available in the BloodHound container.
cert_file and key_file, BloodHound uses HTTPS on that port instead of HTTP.Obtain a TLS certificate and key
openssl:Move the certificate and key to a mountable directory
docker-compose.yml and bloodhound.config.json files and move the certificate and key into it. The examples on this page use a directory named cert:Configure TLS settings
bloodhound.config.json file, set cert_file and key_file to the paths where the certificate and key will be available inside the container.These values must match the container-side destination of the volume mount you add in the next step, not the location of the files on your host:Mount the certificate directory
docker-compose.yml file, mount both the bloodhound.config.json file and the cert directory into the bloodhound service as read-only volumes:docker-compose.yml example ships with the bloodhound.config.json mount commented out. Make sure both volume entries are uncommented before you continue, or the container ignores your custom configuration, leaves tls empty, and continues to serve plain HTTP.Start BloodHound and verify HTTPS
bloodhound container so the new volume mounts and configuration take effect:https://127.0.0.1:8080 and confirm the BloodHound UI loads over HTTPS. Browsers display a certificate warning when you use a self-signed certificate; this is expected and does not occur with a CA-issued certificate.8080 by default).Run multiple instances simultaneously
You might want to run multiple BHCE instances to:- Test a Neo4j backend alongside a PostgreSQL backend
- Evaluate a new version of BHCE without affecting your current installation
- Isolate data for different engagements
Change default BHCE port
docker-compose.yml file, update the BloodHound service port binding to use a different port.The following example uses port 8585 instead of the default 8080 port:Change Neo4j web console port
docker-compose.yml file to use a different port.The following example uses port 7575 instead of the default 7474 port:7687 runs only inside the Docker container, so you do not need to change it.Expose BHCE outside of localhost
You might need to access your BHCE instance from another computer than the one it is installed on. The default installation does not
expose the port outside of localhost. To do it, you will need to change the IP Address the BloodHound UI.
In the docker-compose.yml file, update the BloodHound service port binding to use a different IP Address.
The following example uses IP 0.0.0.0 to bind the port 8080 to all interfaces and IP Addresses on the machine. If the machine has multiple IP Addresses, you can set that specific IP Address.