Skip to content

Commit

Permalink
Fix envs for netbox
Browse files Browse the repository at this point in the history
  • Loading branch information
mmguero committed Sep 19, 2022
1 parent 382d8ea commit cc907c2
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 9 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,9 @@ Malcolm leverages the following excellent open source tools, among others.
* [jQuery File Upload](https://github.com/blueimp/jQuery-File-Upload) - for uploading PCAP files and Zeek logs for processing
* [List.js](https://github.com/javve/list.js) - for the [host and subnet name mapping](#HostAndSubnetNaming) interface
* [Docker](https://www.docker.com/) and [Docker Compose](https://docs.docker.com/compose/) - for simple, reproducible deployment of the Malcolm appliance across environments and to coordinate communication between its various components
* [NetBox](https://netbox.dev/) - a suite for modeling and documenting modern networks
* [PostgreSQL](https://www.postgresql.org/) - a relational database for persisting NetBox's data
* [Redis](https://redis.io/) - an in-memory data store for caching NetBox session information
* [Nginx](https://nginx.org/) - for HTTPS and reverse proxying Malcolm components
* [nginx-auth-ldap](https://github.com/kvspb/nginx-auth-ldap) - an LDAP authentication module for nginx
* [Fluent Bit](https://fluentbit.io/) - for forwarding metrics to Malcolm from [network sensors](#Hedgehog) (packet capture appliances)
Expand Down Expand Up @@ -378,6 +381,7 @@ Checking out the [Malcolm source code](https://github.com/idaholab/Malcolm/tree/
* `logstash` - code and configuration for the `logstash` container which parses Zeek logs and forwards them to the `opensearch` container
* `malcolm-iso` - code and configuration for building an [installer ISO](#ISO) for a minimal Debian-based Linux installation for running Malcolm
* `name-map-ui` - code and configuration for the `name-map-ui` container which provides the [host and subnet name mapping](#HostAndSubnetNaming) interface
* `netbox` - code and configuration for the `netbox`, `netbox-postgres`, `netbox-redis` and `netbox-redis-cache` containers which provide asset management capabilities
* `nginx` - configuration for the `nginx` reverse proxy container
* `pcap` - an initially empty directory for PCAP files to be uploaded, processed, and stored
* `pcap-capture` - code and configuration for the `pcap-capture` container which can capture network traffic
Expand Down
8 changes: 4 additions & 4 deletions docker-compose-standalone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -890,10 +890,10 @@ services:
hostname: netbox
networks:
- default
env_file: ./netbox/env/netbox.env
environment:
<< : *process-variables
VIRTUAL_HOST : 'netbox.malcolm.local'
env_file: ./netbox/env/netbox.env
depends_on:
- netbox-postgres
- netbox-redis
Expand All @@ -918,10 +918,10 @@ services:
hostname: netbox-postgres
networks:
- default
env_file: ./netbox/env/postgres.env
environment:
<< : *process-variables
VIRTUAL_HOST : 'netbox-postgres.malcolm.local'
env_file: ./netbox/env/postgres.env
volumes:
- ./netbox/postgres:/var/lib/postgresql/data:rw
healthcheck:
Expand All @@ -938,10 +938,10 @@ services:
hostname: netbox-redis
networks:
- default
env_file: ./netbox/env/redis.env
environment:
<< : *process-variables
VIRTUAL_HOST : 'netbox-redis.malcolm.local'
env_file: ./netbox/env/redis.env
command:
- sh
- -c
Expand All @@ -962,10 +962,10 @@ services:
hostname: netbox-redis-cache
networks:
- default
env_file: ./netbox/env/redis-cache.env
environment:
<< : *process-variables
VIRTUAL_HOST : 'netbox-redis-cache.malcolm.local'
env_file: ./netbox/env/redis-cache.env
command:
- sh
- -c
Expand Down
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -950,10 +950,10 @@ services:
hostname: netbox
networks:
- default
env_file: ./netbox/env/netbox.env
environment:
<< : *process-variables
VIRTUAL_HOST : 'netbox.malcolm.local'
env_file: ./netbox/env/netbox.env
depends_on:
- netbox-postgres
- netbox-redis
Expand All @@ -978,10 +978,10 @@ services:
hostname: netbox-postgres
networks:
- default
env_file: ./netbox/env/postgres.env
environment:
<< : *process-variables
VIRTUAL_HOST : 'netbox-postgres.malcolm.local'
env_file: ./netbox/env/postgres.env
volumes:
- ./netbox/postgres:/var/lib/postgresql/data:rw
healthcheck:
Expand All @@ -998,10 +998,10 @@ services:
hostname: netbox-redis
networks:
- default
env_file: ./netbox/env/redis.env
environment:
<< : *process-variables
VIRTUAL_HOST : 'netbox-redis.malcolm.local'
env_file: ./netbox/env/redis.env
command:
- sh
- -c
Expand All @@ -1022,10 +1022,10 @@ services:
hostname: netbox-redis-cache
networks:
- default
env_file: ./netbox/env/redis-cache.env
environment:
<< : *process-variables
VIRTUAL_HOST : 'netbox-redis-cache.malcolm.local'
env_file: ./netbox/env/redis-cache.env
command:
- sh
- -c
Expand Down
15 changes: 14 additions & 1 deletion scripts/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,17 @@ def stop(wipe=False):
)

# delete data files (backups, zeek logs, arkime logs, PCAP files, captured PCAP files)
for dataDir in ['opensearch-backup', 'zeek-logs', 'suricata-logs', 'arkime-logs', 'pcap', 'arkime-raw']:
for dataDir in [
'opensearch-backup',
'zeek-logs',
'suricata-logs',
'arkime-logs',
'pcap',
'arkime-raw',
os.path.join('netbox', 'media'),
os.path.join('netbox', 'postgres'),
os.path.join('netbox', 'redis'),
]:
for root, dirnames, filenames in os.walk(os.path.join(MalcolmPath, dataDir), topdown=True, onerror=None):
for file in filenames:
fileSpec = os.path.join(root, file)
Expand All @@ -489,6 +499,9 @@ def stop(wipe=False):
os.path.join('zeek-logs', 'current'),
os.path.join('zeek-logs', 'live'),
os.path.join('suricata-logs'),
os.path.join('netbox', 'media'),
os.path.join('netbox', 'postgres'),
os.path.join('netbox', 'redis'),
]:
RemoveEmptyFolders(dataDir, removeRoot=False)

Expand Down

0 comments on commit cc907c2

Please sign in to comment.