ThreatShield is an AI-powered web application built with Elixir and Phoenix Framework designed to perform threat analysis and threat modeling.
In short, ThreatShield is your Intelligent Threat Analysis Companion.
- ThreatShield
Clone this repo and switch to threat_shield
:
git clone [email protected]:inspired-consulting/ThreatShields.git
The Threat Shield application requires the environment variables that are defined in the .env
file provided to you. Copy the file into the root of this application.
To run the Threat Shield application, you will need the following installed on your system:
Build and start the app:
cd threat_shield
docker compose up --build
Start the app:
cd threat_shield
docker compose up
Navigate to localhost:4000 in your browser, you're set to go.
To access the app container, you can use the following command:
docker exec -it ThreatShield-server /bin/sh
To access the database container, you can use the following command:
docker exec -it ThreatShield-db /bin/sh
Run the following command in your terminal to stop the Docker container via docker compose:
docker compose down
or
use the Ctrl+C
command twice in your terminal to stop the application.
To run the tests, access the app container, and use the following command:
MIX_ENV=test mix test
You will need the following installed on your system:
- Erlang/OTP >= 26
- Elixir >= 1.15
- Node.js >= 18.17
If you use asdf, you can install these dependencies with asdf install
.
You also need to set up a PostgreSQL database. For local development, you can use Docker, e.g.:
docker run -e POSTGRES_USER=threat_shield -e POSTGRES_PASSWORD=secret -e POSTGRES_DB=threat_shield -p 5432:5432 --name threat-shield-db -d postgres:14
For local testing a separate DB is necessary. You can create this besides the dev database in the same docker instance:
docker exec -it threat-shield-db psql -h localhost -U threat_shield -c "CREATE DATABASE threat_shield_test;"
To start your Phoenix server:
cd threat_shield
mix setup
mix phx.server
Navigate to localhost:4000 in your browser, you're set to go.
Use the Ctrl+C
command twice in your terminal to stop the application.
To create a secret for the GitHub Container Registry to pull the image from, run the following command:
kubectl create secret docker-registry github-container-registry \
--namespace=threatshield \
--docker-server=ghcr.io \
--docker-username=<github-username> \
--docker-password=<token>
For more context: Set up Kubernetes secret.