A collaborative network / infrastructure visualization tool oriented towards use for defensive and offensive cyber operations
References:
- https://github.com/docker/awesome-compose/tree/master/nginx-flask-mysql
- https://flask.palletsprojects.com/en/2.3.x/patterns/packages/
Project structure:
.
├── compose.yaml
├── backend
│ ├── Dockerfile
│ ├── requirements.txt
│ └── looking_glass
│ └── app.py
├── db
│ └── password.txt
├── proxy
│ ├── Dockerfile
│ └── conf
└── scripts
- From the project root:
docker compose up -d - Navigate to the appropriate URL
docker compose down
From the command line, execute: FLASK_APP=looking_glass/app.py flask run
This will make the application accessible locally at http://127.0.0.1:5000
To make the application accessible to other computers, add --host=0.0.0.0 to the end of the command: FLASK_APP=application.py flask run --host=0.0.0.0
Note: this is not recommended for production use and exposing a local webserver on your machine over the network has potential security considerations. Please do this with care.
- Install Docker: sudo yum install docker
- Add user to the docker group: sudo usermod -aG docker $USER
- Install Docker Compose (https://docs.docker.com/compose/install/linux/#install-using-the-repository)
- DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
- mkdir -p $DOCKER_CONFIG/cli-plugins
- curl -SL https://github.com/docker/compose/releases/download/v2.18.1/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose
- chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
- Start Docker service: sudo service docker start
- Start a new terminal session for the current user to refresh the user group membership
- Run the
scripts/bundle_app.shscript. Will create a bundled app file namedlooking_glass.app
- Use the steps above (or run the
scripts/install_docker.shscript) to install docker and docker compose on the server - Make the bundle executable:
chmod +x looking_glass.app - Run the bundle:
./looking_glass.app
cd looking_glassdocker compose down
cd looking_glassdocker compose up -d --no-build
- Enable debugging, add the following lines to the
backendportion of thecompose.yamlfile: ``` stdin_open: true tty: true
1. Set a breakpoint in the application code: `import pdb; pdb.set_trace()`
1. Rebuild the containers: `./scripts/clean_build_and_run.sh`
1. Attach to the backend container; will drop you into a pdb session when the breakpoint is hit: `scripts/pdb_attach.sh`