Sign inSign up

andrewixl/tierzerocode

By andrewixl

Updated 8 months ago

Tier Zero C.O.D.E (Tier Zero Correlation of Distributed Endpoints)

Image
Security
Web servers
Monitoring & observability
0

2.0K

andrewixl/tierzerocode repository overview

Tier Zero C.O.D.E Logo

Tier Zero C.O.D.E (Tier Zero Correlation of Distributed Endpoints)

Tier Zero C.O.D.E is an enterprise-level security dashboard designed to correlate and manage endpoint data from multiple distributed security tools and platforms. It provides a unified view of your organization's endpoints, users, and security posture by integrating with leading security solutions including Microsoft Entra ID, CrowdStrike Falcon, Microsoft Defender for Endpoint, Microsoft Intune, Sophos Central, and Qualys.

Key Features

  • Unified Endpoint Management: Centralize endpoint data from multiple security platforms into a single dashboard
  • User and Device Correlation: Track and correlate user and device information across your security ecosystem
  • Multi-Platform Integration: Seamlessly integrate with major security vendors and platforms
  • Real-time Monitoring: Monitor endpoint compliance, security status, and user activity in real-time
  • Enterprise-Ready: Built with Django and designed for enterprise-scale deployments

Repository Stats

GitHub license GitHub last commit GitHub issues Docker pulls

Repository Technologies

Python Django PostgreSQL Redis Docker

Minimum Requirements

  • 2 CPU Cores
  • 4 GB RAM
  • 32 GB SSD
  • 4 CPU Cores
  • 8 GB RAM
  • 64 GB SSD

Prerequisites

Before you begin, ensure you have the following installed:

  • Docker (version 20.10 or later)
  • Docker Compose (version 2.0 or later)
  • Network access to your security platform APIs (Microsoft Entra ID, CrowdStrike, etc.)

Getting started

Docker Install: Latest

andrewixl/tierzerocode:latest

Docker Install: Latest - Dev

andrewixl/tierzerocode:latest-dev

Production Deployment with Docker Compose

Full Stack (Web + Worker + Database + Redis)

This setup runs everything in Docker Compose, including PostgreSQL and Redis:

  1. Create a docker-compose.yml file:
services:
  web:
    image: docker.io/andrewixl/tierzerocode:latest
    ports:
      - "${WEB_PORT:-8000}:8000"
    environment:
      # Django settings
      - SECRET_KEY=${SECRET_KEY}
      - DEBUG=${DEBUG:-False}
      - DJANGO_ALLOWED_HOSTS=${DJANGO_ALLOWED_HOSTS:-localhost,127.0.0.1}
      # Database settings
      - DATABASE_HOST=db
      - DATABASE_NAME=${DATABASE_NAME:-dockerdjango}
      - DATABASE_USER=${DATABASE_USER:-dbuser}
      - DATABASE_PASSWORD=${DATABASE_PASSWORD:-dbpassword}
      - DATABASE_PORT=${DATABASE_PORT:-5432}
      - DATABASE_ENGINE=${DATABASE_ENGINE:-postgresql_psycopg2}
      # Redis settings
      - REDIS_HOST=redis
      - REDIS_PORT=${REDIS_PORT:-6379}
      - REDIS_DB=${REDIS_DB:-0}
    depends_on:
      - db
      - redis
    restart: unless-stopped
    command: python -m gunicorn --bind 0.0.0.0:8000 --workers ${GUNICORN_WORKERS:-3} tierzerocode.wsgi:application

  worker:
    image: docker.io/andrewixl/tierzerocode:latest
    environment:
      # Django settings
      - SECRET_KEY=${SECRET_KEY}
      - DEBUG=${DEBUG:-False}
      - DJANGO_ALLOWED_HOSTS=${DJANGO_ALLOWED_HOSTS:-localhost,127.0.0.1}
      # Database settings
      - DATABASE_HOST=db
      - DATABASE_NAME=${DATABASE_NAME:-dockerdjango}
      - DATABASE_USER=${DATABASE_USER:-dbuser}
      - DATABASE_PASSWORD=${DATABASE_PASSWORD:-dbpassword}
      - DATABASE_PORT=${DATABASE_PORT:-5432}
      - DATABASE_ENGINE=${DATABASE_ENGINE:-postgresql_psycopg2}
      # Redis settings
      - REDIS_HOST=redis
      - REDIS_PORT=${REDIS_PORT:-6379}
      - REDIS_DB=${REDIS_DB:-0}
    depends_on:
      - db
      - redis
    restart: unless-stopped
    command: python manage.py rqworker default --job-class django_tasks.backends.rq.Job --with-scheduler

  db:
    image: postgres:17-bookworm
    environment:
      - POSTGRES_DB=${DATABASE_NAME:-dockerdjango}
      - POSTGRES_USER=${DATABASE_USER:-dbuser}
      - POSTGRES_PASSWORD=${DATABASE_PASSWORD:-dbpassword}
    volumes:
      - postgres_data:/var/lib/postgresql/data
    restart: unless-stopped

  redis:
    image: redis:7-alpine
    restart: unless-stopped
    volumes:
      - redis_data:/data
    command: redis-server --appendonly yes

volumes:
  postgres_data:
  redis_data:
  1. Create a .env file with your configuration:
SECRET_KEY=your-secret-key-here # Generate with: openssl rand -base64 32
DEBUG=False
DJANGO_ALLOWED_HOSTS=ipaddress,yourdomain.com,
DATABASE_NAME=dockerdjango
DATABASE_USER=dbuser
DATABASE_PASSWORD=dbpassword
GUNICORN_WORKERS=3
WEB_PORT=8000
USE_HTTPS=False
  1. Pull and start all services:
sudo docker compose pull
sudo docker compose up -d
  1. Run migrations:
sudo docker compose exec web python manage.py migrate
  1. OPTIONAL Create superuser (if needed):
sudo docker compose exec web python manage.py createsuperuser
  1. Access the application:
    • Open your browser and navigate to http://ipaddress:8000 (or your configured WEB_PORT)
    • Create Administrator Account (or Log in with the superuser credentials you created)
Configuration

The following environment variables can be configured in your .env file:

Django Settings
  • SECRET_KEY - Django secret key (required for production) Generate with: openssl rand -base64 32
  • DEBUG - Enable debug mode (default: False)
  • DJANGO_ALLOWED_HOSTS - Comma-separated list of allowed hostnames
  • USE_HTTPS=False - True / False
Database Settings
  • DATABASE_HOST - PostgreSQL host (default: db for Docker Compose)
  • DATABASE_NAME - Database name (default: dockerdjango)
  • DATABASE_USER - Database user (default: dbuser)
  • DATABASE_PASSWORD - Database password (default: dbpassword)
  • DATABASE_PORT - Database port (default: 5432)
  • DATABASE_ENGINE - Database engine (default: postgresql_psycopg2)
Redis Settings
  • REDIS_HOST - Redis host (default: redis for Docker Compose)
  • REDIS_PORT - Redis port (default: 6379)
  • REDIS_DB - Redis database number (default: 0)
Performance Settings
  • GUNICORN_WORKERS - Number of Gunicorn worker processes (default: 3)
  • WEB_PORT - Port to expose the web service (default: 8000)
Managing Services
  • View logs: sudo docker compose logs -f web or docker compose logs -f worker
  • Stop services: sudo docker compose down
  • Restart a service: sudo docker compose restart web
  • Scale workers: Edit docker-compose.yml and use sudo docker compose up -d --scale worker=3
Image Tags

The docker compose files use docker.io/andrewixl/tierzerocode:latest by default. To use a specific version:

image: docker.io/andrewixl/tierzerocode:latest-dev
image: docker.io/andrewixl/tierzerocode:v1.0.0 (legacy to be updated)

Required Permissions per Integration

  • CrowdStrike Falcon
    • Hosts - Read
  • Microsoft Defender for Endpoint
    • WindowsDefenderATP - Machine.Read.All - Application Permissions
  • Microsoft Entra ID
    • Microsoft Graph - Device.Read.All - Application Permissions
    • Microsoft Graph - AuditLog.Read.All - Application Permissions
  • Microsoft Intune
    • Microsoft Graph - DeviceManagementManagedDevices.Read.All - Application Permissions
  • Sophos Central
    • API Credential - Service Principal Management Role

Integrate with your tools

  • Microsoft Entra ID (Devices and Users Data)
  • Cloudflare Zero Trust
  • CrowdStrike Falcon
  • Microsoft Defender for Endpoint
  • Microsoft Intune
  • Sophos Central
  • Qualys Vulnerability Management (Limited to First 1000 Devices)

Roadmap

  • Qualys Vulnerability Management (All Devices)
  • JAMF Pro (Under Development)
  • Tenable (Under Development)

Troubleshooting

Common Issues

Database connection errors:

  • Ensure PostgreSQL container is running: sudo docker compose ps
  • Check database credentials in .env file
  • Verify network connectivity between containers

Redis connection errors:

  • Ensure Redis container is running: sudo docker compose ps
  • Check Redis configuration in .env file

Static files not loading:

  • Run collectstatic: sudo docker compose exec web python manage.py collectstatic --noinput

Worker not processing jobs:

  • Check worker logs: sudo docker compose logs -f worker
  • Ensure Redis is accessible from worker container

Port already in use:

  • Change WEB_PORT in .env file to an available port
  • Or stop the service using port 8000
Getting Help

If you encounter issues not covered here:

  1. Check the GitHub Issues for similar problems
  2. Review container logs: sudo docker compose logs -f [service-name]
  3. Create a new issue with:
    • Description of the problem
    • Steps to reproduce
    • Relevant log output
    • Your environment (Docker version, OS, etc.)

Security Considerations

  • Change default credentials: Always change default database and application credentials
  • Use strong SECRET_KEY: Generate a secure Django secret key for production
  • HTTPS in production: Use a reverse proxy (nginx, Traefik) with SSL/TLS certificates
  • Network security: Restrict access to the application and database containers
  • Regular updates: Keep Docker images and dependencies updated
  • Backup strategy: Implement regular backups of PostgreSQL data volumes
  • API credentials: Store integration API keys securely (consider using secrets management)

Support

Please submit any issues into the issues section within this GitHub

Contribute

If you are feeling generous, love the project, or just want to show your appreciation please donated at the Patreon Link Below! https://www.patreon.com/tierzerocode

License

Distributed under the Apache License Version 2.0. See LICENSE for more information.

Tag summary

Content type

Image

Digest

sha256:3fd54b31f

Size

107.7 MB

Last updated

8 months ago

docker pull andrewixl/tierzerocode