{"id":18353565,"url":"https://github.com/felbinger/netbox_cybex","last_synced_at":"2025-04-06T12:31:40.367Z","repository":{"id":222373034,"uuid":"756924248","full_name":"felbinger/netbox_cybex","owner":"felbinger","description":"Features for cyber exercises in NetBox","archived":true,"fork":false,"pushed_at":"2024-02-24T18:35:44.000Z","size":308,"stargazers_count":2,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-15T16:27:53.774Z","etag":null,"topics":["netbox","netbox-plugin"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/felbinger.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-13T15:17:18.000Z","updated_at":"2024-07-03T18:38:04.000Z","dependencies_parsed_at":"2024-02-14T21:29:05.481Z","dependency_job_id":"89c42bc6-1a5c-4c81-8781-93e5fc3992ab","html_url":"https://github.com/felbinger/netbox_cybex","commit_stats":null,"previous_names":["felbinger/netbox-plugin-credentials","felbinger/netbox_cybex"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felbinger%2Fnetbox_cybex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felbinger%2Fnetbox_cybex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felbinger%2Fnetbox_cybex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felbinger%2Fnetbox_cybex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/felbinger","download_url":"https://codeload.github.com/felbinger/netbox_cybex/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247484291,"owners_count":20946384,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["netbox","netbox-plugin"],"created_at":"2024-11-05T21:42:11.693Z","updated_at":"2025-04-06T12:31:39.741Z","avatar_url":"https://github.com/felbinger.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Netbox Plugin: CybEx\n\nThis plugin adds features for cyber exercises to your \n[NetBox](https://github.com/netbox-community/netbox) instance. It should be \nused exclusively for IT security trainings and cyber exercises where \napplications such as Netbox are out of scope. Do **not** use parts of this \nplugin (e.g., the credentials section) in a non-training environment!\n\n## Preview\n![](./img/credential_list.png)\n\n![](./img/credential_add.png)\n\n![](./img/credential_inline_device.png)\n\n## Deployment\n### Docker\n- see: https://github.com/netbox-community/netbox-docker/wiki/Using-Netbox-Plugins:\n```Dockerfile\n# Dockerfile-Plugins\nFROM netboxcommunity/netbox:latest\n\nCOPY ./plugin_requirements.txt /opt/netbox/\nRUN /opt/netbox/venv/bin/pip install  --no-warn-script-location -r /opt/netbox/plugin_requirements.txt\n\n# These lines are only required if your plugin has its own static files.\nCOPY configuration/configuration.py /etc/netbox/config/configuration.py\nCOPY configuration/plugins.py /etc/netbox/config/plugins.py\nRUN SECRET_KEY=\"dummydummydummydummydummydummydummydummydummydummy\" /opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py collectstatic --no-input\n```\n- override mountpoint for templates:\n```yaml\n# docker-compose.override.yml\nversion: '3.4'\n\nservices:\n  netbox:\n    image: netbox:latest-plugins\n    ports:\n      - 8000:8080\n    build:\n      context: .\n      dockerfile: Dockerfile-Plugins\n    volumes:\n      - \"./netbox_cybex/netbox_cybex/templates/dcim/device.html:/opt/netbox/netbox/templates/dcim/device.html\"\n      - \"./netbox_cybex/netbox_cybex/templates/virtualization/virtualmachine.html:/opt/netbox/netbox/templates/virtualization/virtualmachine.html\"\n      - \"./netbox_cybex/netbox_cybex/templates/netbox_cyber:/opt/netbox/netbox/templates/netbox_cyber/\"\n\n  netbox-worker:\n    image: netbox:latest-plugins\n    build:\n      context: .\n      dockerfile: Dockerfile-Plugins\n\n  netbox-housekeeping:\n    image: netbox:latest-plugins\n    build:\n      context: .\n      dockerfile: Dockerfile-Plugins\n```\n\n### NixOS\nA default netbox deployment for NixOS can be found on \n[github:secshellnet/nixos](https://github.com/secshellnet/nixos/blob/main/modules/netbox.nix), \nyou can add plugins like this:\n```\n{ lib\n, ...\n}: let\n  netbox_cybex = ps: ps.buildPythonPackage rec {\n    pname = \"netbox_cybex\";\n    version = \"0.1\";\n    format = \"pyproject\";\n\n    src = ps.fetchPypi {\n      inherit pname version;\n      hash = \"sha256-YfC5aOHQQqjTCv2mac+p/1zX/8M+TemYyoim9YSXJPs=\";\n    };\n\n    nativeBuildInputs = with ps; [\n      setuptools\n    ];\n\n    meta = with lib; {\n      description = \"Features for cyber exercises in NetBox\";\n      homepage = \"https://github.com/felbinger/netbox_cybex\";\n      license = licenses.mpl20;\n      platforms = platforms.linux;\n    };\n  };\nin {\n\n  # Your NetBox configuration\n  # ...\n\n  services.netbox.plugins = (ps: [ (netbox_cybex ps) ]);\n  services.netbox.settings.PLUGINS = [ \"netbox_cybex\" ];\n}\n```\n\n## Development Environment\n```sh\ngit clone --branch v3.7.2 --single-branch https://github.com/netbox-community/netbox ~/netbox\npython3 -m venv ~/netbox/venv\nsource ~/netbox/venv/bin/activate\npip3 install -r ~/netbox/requirements.txt\n\n# create configuration from example\ncat ~/netbox/netbox/netbox/configuration_example.py | \\\n  sed -e \"s/^DEBUG.*/DEBUG = True/\" | \\\n  sed -e \"s/^SECRET_KEY.*/SECRET_KEY = '$(~/netbox/netbox/generate_secret_key.py)'/\" | \\\n  sed -e \"s/^ALLOWED_HOSTS.*/ALLOWED_HOSTS = \\[\\'127.0.0.1\\'\\]/\" | \\\n  sed -e \"s/'USER': ''/'USER': 'postgres'/\" \u003e ~/netbox/netbox/netbox/configuration.py\n\n# start database and redis\ndocker compose up -d\n\n~/netbox/netbox/manage.py migrate\n~/netbox/netbox/manage.py createsuperuser \\\n  --username admin \\\n  --email admin@localhost.localdomain\n~/netbox/netbox/manage.py runserver\n\n# netbox should now reachable on: http://127.0.0.1:8000/\n\n# build plugin\npython3 setup.py develop\n\n# add plugin to configuration\nsed -i -e \"s/^PLUGINS.*/PLUGINS = \\['netbox_cybex'\\]/\" ~/netbox/netbox/netbox/configuration.py\n\n# enable developer mode to enable usage of makemigrations\necho \"DEVELOPER=True\" \u003e\u003e ~/netbox/netbox/netbox/configuration.py\n\n# Building the app\n~/netbox/netbox/manage.py makemigrations\n~/netbox/netbox/manage.py migrate\n\n# Publish\npython3 -m pip install --upgrade build twine\npython3 -m build\npython3 -m twine upload --repository pypi dist/*\n```\n\n## TODO\n- Think about other useful extensions\n  - Firewall\n    - generate rules for iptables/vyatta/firewalld (maybe even commands to add them to pfsense if somehow possible)\n    - need to be easily manageable using importable data, otherwise gui needs to be used, which sucks... (same with pfSense)\n- Test API (Make sure it's working as expected)\n- Create ansible module `cybex.netbox.netbox_credential` to add creds to existing virtual machine\n- Package for nix\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelbinger%2Fnetbox_cybex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffelbinger%2Fnetbox_cybex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelbinger%2Fnetbox_cybex/lists"}