Even if there are tools in Malcolm and NetBox itself getting data into NetBox, this data should be standardized. This is done by this plugin, which contains the source code for the BSI Project 507 TP2. The DDDC plugin can receive input data from various sources, supports the processing and approval of this data in order to build a standardized device database within NetBox.\ The main features are further developed in the repository String-Atlas. This processes the data before it is placed in the NetBox framework. This ensures that the data is adapted to support IT security management tasks such as device management, vulnerability management and patch management.
In addition to the plugin code, this repository contains additional files for the community-driven Docker image integrating the DDDC Plugin in development mode. This is primarily used for test purposes for the CI/CD pipeline and can be used for testing the plugin within an exemplary NetBox environment.
As the DDDC plugin is a standard NetBox plugin, it can be installed according to the NetBox documentation. This plugin is compatible with NetBox version 4.2.7 and ensured by the docker file.
Additionally, this repository contains files from the community-driven Docker image to set up NetBox, along with all its dependencies, such as a PostgreSQL database. Please note: This is not an installation for a production environment, as it uses default passwords and API keys as specified in the project's files. Furthermore, this installation sets up NetBox in 'developer mode', which means that the user will receive detailed information in case of an exception. This is very useful for alpha and beta testing, which is why this installation option is described below:
DDDC is only compatible with NetBox 4.2 and therefore with netbox-docker 3.2.1. For a new install, clone from tag 3.2.1:
git clone -b 3.2.1 https://github.com/netbox-community/netbox-docker.gitFor existing installations, switch to tag 3.2.1 before continuing:
git checkout 3.2.1The Plugin can be added to any existing or new setup of netbox-docker by following their plugin instructions.
-
Create the file
plugin_requirements.txtwith the following content:git+https://github.com/DINA-community/DDDC-Netbox-plugin.git
-
Create the file
Dockerfile-Pluginswith the content from the netbox-docker documentation. Add this snippet before the lineRUN /usr/local/bin/uv pip:RUN apt-get update && DEBIAN_FRONTEND="noninteractive" apt install -y git
Also, replace
FROM netboxcommunity/netbox:latest
with
FROM netboxcommunity/netbox:v4.2-3.2.1
Matching the version of netbox-docker.
-
Create the file
docker-compose.override.ymlwith the content from the netbox-docker documentation.You can also create a superuser by adding these lines with meaningful values. Alternatively, create the superuser in step 6.
environment: SKIP_SUPERUSER: "false" #SUPERUSER_API_TOKEN: "" SUPERUSER_EMAIL: "" SUPERUSER_NAME: "" SUPERUSER_PASSWORD: ""
Also, change the image versions
image: netbox:v4.2-3.2.1
for all services
-
Add this to
configuration/plugins.py:PLUGINS = ["d3c"]
You can also add a section
PLUGINS_CONFIGfor d3c here. -
Build and run it (see Troubleshoot):
docker compose build --no-cache docker compose up -d
-
Access your local netbox by http://127.0.0.1:8000. To create an admin user, run this command:
docker compose exec netbox /opt/netbox/netbox/manage.py createsuperuser
This Dockerfile simply extends the netbox-docker project with the custom DDDC-plugin. Therefore, the dependencies of the netbox-docker project also apply for this installation:
Recommendation: Install docker with the Compose v2 already integrated into the Docker CLI platform.
To check the version installed on your system run docker --version and docker compose version.
After the installation, NetBox is available at http://127.0.0.1:8000. Therefore, for simplicity, a web browser should be available on the installed system.
-
Execute the following commands for ubuntu:
# Add official GPG key from docker apt update apt install apt-transport-https ca-certificates curl echo "deb [signed-by=/etc/apt/trusted.gpg.d/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list curl -fsSL "https://download.docker.com/linux/ubuntu/gpg" | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/docker.gpg > /dev/null apt-cache policy docker-ce apt-get install docker-ce
git clone https://github.com/DINA-community/DDDC-Netbox-plugin.git cd DDDC-Netbox-plugin/ docker compose build --no-cache docker compose up -
Wait until
Initialization is done.is printed. Afterwards the GUI can be accessed via http://127.0.0.1:8000. -
Login as
- BN: admin
- PW: admin
After testing, the containers can be stopped by pressing Ctrl+C and restarted using docker-compose up.
To enable the netbox debug mode, to get long and detailed tracebacks, add this to docker-compose.override.yml in the section netbox:
environment:
- DEBUG=True
The installation will provide a warning message since the installation is using the default security token:
⚠️ Warning: You have the old default admin token in your database. This token is widely known; please remove it.
In theory, you can add an alternative security token in the file netbox.env by adding the following line:
SUPERUSER_API_TOKEN=<Token>However, an important aspect of an installation in a production environment is the creation of users, tokens, and their permissions. This must be done for each NetBox installation separately and in accordance with the specific requirements in place.
The unit tests of NetBox can be executed via ./docker-ci/test.sh.
This section contains links for familiarizing yourself with Django, NetBox, and plugins.
- Installation of NetBox as a standalone, self-hosted application: https://docs.netbox.dev/en/stable/installation/
- Community driven Docker image for netbox: https://github.com/netbox-community/netbox-docker
- Using NetBox Plugins in Docker: https://github.com/netbox-community/netbox-docker/wiki/Using-Netbox-Plugins
- Official plugin development documentation of NetBox: https://docs.netbox.dev/en/stable/plugins/development/
- NetBox plugin development Tutorial: https://github.com/netbox-community/netbox-plugin-tutorial
- Setting up a development environment with Docker for NetBox plugins: netbox-community/netbox-docker#746
- django-table2 Documentation used by the Plugin and NetBox: https://django-tables2.readthedocs.io/en/latest/