Skip to content

Latest commit

 

History

History
65 lines (51 loc) · 3.63 KB

File metadata and controls

65 lines (51 loc) · 3.63 KB

BloodHound Community Edition Development

Welcome to BloodHound Community Edition! This README should help point you in the right direction if you're looking to begin development with BloodHound. It is intended to be a simple place to look to get your dev environment set up.

More detailed information regarding contributing, code structure, and development can be found in our GitHub wiki.

Dev Environment Prerequisites

  • Git
    • for Windows, the git installer is a simple option that also comes with git-bash
    • for WSL, Linux, and macOS, git should be included in your distro
  • Docker
    • for linux and WSL, installing the docker cli engine is a pretty straight forward solution
    • for Mac and Windows, the docker desktop app is the easiest option
  • Colima is another option for macOS users
  • just
    • just has many installation options, but the simplest option may be to install the npm package using node
  • NodeJS v22
    • installation using a node version manager like nvm or n is recommended
  • Yarn v3.6
    • installation using npm corepack is recommended (instructions in the link above)
  • Go v1.26.4
    • goimports is also needed
    • make sure $HOME/go/bin (or wherever your Go packages are installed) is in your $PATH
  • Python v3.10

Quick Start

Please make sure you have all dev requisites and docker is running!

  • Run just init
    • this should only ever be run once; the only reason to run it again is if you wipe the repo and start fresh or if you want to wipe your config files and start over
  • Run just bh-dev
  • To access the UI, navigate to http://bloodhound.localhost.

Quick Tips

  • To see just recipes, run the just command in the project root
  • Code generation: just generate
  • Running tests:
    • only unit tests: just test
    • unit + integration tests: just test -i
  • Before creating a PR and requesting code review: just prepare-for-codereview

Default Admin

There are two ways a default admin is created in the dev environment. If you would like to have precise control over the default admin, make sure a default_admin is set in local-harnesses/build.config.json. If you prefer a randomly generated user, remove the default_admin part of the config. This option will create a user called admin and randomly generate a password which will be printed to the console output. This only happens on the first startup when the user is created. If the application has already been bootstrapped, and you want to change how the default admin is created, you will need to clear the data volumes and rebuild the docker containers.

Package Names

Packages in the BHCE repo will follow one of two conventions:

  • If the package lives within cmd/api/src:
    • github.com/specterops/bloodhound/cmd/api/src/<path-to>/<package>
    • is covered by the go.mod file in the src directory
  • If the package lives within packages/go:
    • github.com/specterops/bloodhound/<package>
    • requires its own go.mod