Skip to content

This project helps organizations to identify potential threats to their systems.

Notifications You must be signed in to change notification settings

inspired-consulting/threat_shield

Repository files navigation

ThreatShield

Safeguarding Your Digital Realm

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.

Table of Contents

Development setup

Clone this repo and switch to threat_shield:

git clone [email protected]:inspired-consulting/ThreatShields.git

Configuration

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.

Development setup with docker

Prerequisites for docker

To run the Threat Shield application, you will need the following installed on your system:

Usage with docker

Building and running the application

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.

Accessing the containers

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

Stopping the containers/application

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.

Testing your application

To run the tests, access the app container, and use the following command:

MIX_ENV=test mix test

Development setup with CLI tools

Prerequisites for CLI tools

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;"

Usage with CLI tools

Running the application

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.

Stopping the server/application

Use the Ctrl+C command twice in your terminal to stop the application.

CI/CD Deployment

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.

About

This project helps organizations to identify potential threats to their systems.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •