Skip to content

ShieldX is an advanced cloud security platform that protects web applications and APIs from sophisticated cyber attacks through, in the process of detecting incomplete systems

License

Notifications You must be signed in to change notification settings

shieldx-bot/shieldx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

74 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

πŸ›‘οΈ ShieldX - AI-Powered Cloud Security Platform

Next-generation cloud security combining AI/ML threat detection, deception technology, and sandbox isolation.

CI Security Scan License: Apache-2.0 Go Version PRs Welcome

Documentation Β· Architecture Β· API Reference Β· Report an Issue

Status: πŸ§ͺ ALPHA / EXPERIMENTAL – This project is under active development and is not yet production-ready. We welcome contributions to help us move forward!


πŸ“– Table of Contents


What is ShieldX?

ShieldX is a comprehensive, cloud-native security platform designed to protect modern web applications and APIs from sophisticated cyber threats. It integrates multiple advanced security technologies into a unified, extensible, and high-performance system.

✨ Key Features

Feature Description
πŸ” AI/ML Threat Detection Utilizes behavioral analysis and machine learning models to detect anomalies, score threats in real-time, and adapt to emerging attack patterns.
🎭 Deception Technology Employs dynamic honeypots and server fingerprint camouflage to trap, mislead, and analyze attackers' behavior within a controlled environment.
πŸ”’ Sandbox Isolation Executes suspicious and untrusted code in hardware-level isolated Firecracker MicroVMs, monitored by eBPF for deep syscall-level visibility.
πŸ” Continuous Authentication Verifies user identity continuously through behavioral biometrics, including keystroke dynamics, mouse patterns, and device fingerprinting.
πŸ“‹ Policy Orchestration Integrates Open Policy Agent (OPA) for powerful, declarative policy-as-code. Policies are delivered as cryptographically signed bundles for secure, dynamic evaluation.

🎯 Use Cases

  • Advanced Web Application Firewall (WAF) - Protect against the OWASP Top 10, zero-day threats, and business logic abuse.
  • API Security Gateway - Enforce rate limiting, authentication, and threat analysis for microservices and public APIs.
  • Malware Analysis Sandbox - Provide a safe execution environment for forensic analysis of potentially malicious files and payloads.
  • Fraud Prevention - Leverage behavioral biometrics to detect account takeovers and fraudulent activities.
  • Compliance Enforcement - Generate immutable audit trails to help meet SOC 2, ISO 27001, GDPR, and PCI DSS requirements.

🧠 Core Concepts

Request Flow

graph LR
    subgraph "Main Traffic Flow"
        Client[<font size=4>πŸ‘¨β€πŸ’»<br>Client</font>] --> Ingress[<font size=4>πŸšͺ<br>Ingress Gateway</font>]
        Ingress --> Orchestrator[<font size=4>🧠<br>Orchestrator</font>]
    end

    subgraph "Analysis & Decision Loop"
        Orchestrator -- "Suspicious Request" --> Guardian[<font size=4>πŸ›‘οΈ<br>Guardian (Sandbox)</font>]
        Guardian -- "Malware Analysis" --> Firecracker[<font size=4>πŸ”₯<br>Firecracker + eBPF</font>]
        Orchestrator -- "Behavioral Auth" --> ContAuth[<font size=4> B<br>ContAuth</font>]
        Orchestrator -- "Policy Check" --> OPAPolicy[<font size=4>πŸ“œ<br>OPA Policy Engine</font>]
        Orchestrator -- "Resource Check" --> Credits[<font size=4>πŸ’³<br>Credits Service</font>]
    end

    Orchestrator -- "Valid Request" --> Upstream[<font size=4>🌐<br>Upstream Service</font>]
    Guardian -- "Analysis Result" --> Orchestrator
    ContAuth -- "Risk Score" --> Orchestrator
    OPAPolicy -- "Decision" --> Orchestrator
Loading

πŸ—οΈ System Architecture

Service Overview

Service Port Technology Purpose
Orchestrator 8080 Go, OPA Central routing & policy evaluation engine
Ingress 8081 Go, QUIC Traffic gateway & rate limiting
Guardian 9090 Go, Firecracker, eBPF Sandbox execution & threat analysis
Credits 5004 Go, PostgreSQL Resource management & billing
ContAuth 5002 Go, Python (ML) Continuous behavioral authentication
Shadow 5005 Go, Docker Safe rule testing environment
Policy Rollout 5006 Go Controlled policy bundle promotion
Verifier Pool 5007 Go Attestation & integrity verification
Locator 5008 Go, Consul Service discovery & health monitoring

For a deep dive, see the full System Architecture Document.


πŸš€ Getting Started

Prerequisites

Required:

  • Go 1.22 or higher
  • Docker 24.0+ & Docker Compose 2.20+
  • make
  • git

Recommended:

  • 4GB+ RAM
  • Linux Kernel 5.10+ with KVM support (/dev/kvm) for the Guardian service.

Quick Start Installation

  1. Clone the repository:

    git clone https://github.com/shieldx-bot/shieldx.git
    cd shieldx
  2. Install dependencies:

    go mod download && go mod verify
  3. Build all service binaries:

    make build
  4. Start infrastructure services (PostgreSQL, Redis):

    docker compose up -d postgres redis
  5. Run database migrations:

    make migrate-up
  6. Start all ShieldX services:

    make run-all
  7. Verify that services are running:

    make health-check

    Expected Response from each healthy service:

    {
      "status": "healthy",
      "version": "0.1.0",
      "timestamp": "2025-10-08T10:00:00Z"
    }

πŸ› οΈ Service Setup Guides

For detailed setup, configuration, and API documentation for each microservice, please refer to the README.md within its respective directory. The following are quick-start summaries.

<details> <summary><b>1. Orchestrator Service (:8080)</b></summary>

Purpose: Central routing and policy evaluation engine.

Setup:

cd services/orchestrator

# Create .env file for configuration
cat > .env << EOF
ORCHESTRATOR_PORT=8080
REDIS_HOST=localhost
REDIS_PORT=6379
OPA_BUNDLE_URL=http://localhost:8181/bundles/latest
LOG_LEVEL=info
EOF

# Run the service
go run cmd/server/main.go

See more: services/orchestrator/README.md

</details>

<details> <summary><b>2. Ingress Service (:8081)</b></summary>

Purpose: Traffic gateway with rate limiting and filtering.

Setup:

cd services/ingress

# Create .env file for configuration
cat > .env << EOF
INGRESS_PORT=8081
REDIS_HOST=localhost
RATE_LIMIT_PER_MINUTE=1000
ENABLE_QUIC=true
EOF

# Run the service
go run cmd/server/main.go

See more: services/ingress/README.md

</details>

<details> <summary><b>3. Guardian Service (:9090)</b></summary>

Purpose: Sandbox execution with Firecracker MicroVMs.

Requirements: Linux kernel 5.10+, KVM enabled, and root privileges (sudo).

Setup:

cd services/guardian

# Verify KVM support
ls -l /dev/kvm && lsmod | grep kvm

# Create .env file with paths to your kernel and rootfs
cat > .env << EOF
GUARDIAN_PORT=9090
FIRECRACKER_KERNEL=/path/to/vmlinux
FIRECRACKER_ROOTFS=/path/to/rootfs.ext4
SANDBOX_TIMEOUT=30
MAX_MEMORY_MB=512
EOF

# Run with elevated privileges
sudo go run cmd/server/main.go

Note: Guardian requires Linux. On Windows/macOS, it will run in a limited stub mode. See more: services/guardian/README.md

</details>

<details> <summary><b>4. Credits Service (:5004)</b></summary>

Purpose: Resource consumption tracking and billing.

Setup:

cd services/shieldx-credits

# Ensure PostgreSQL is running via docker-compose

# Create .env file
cat > .env << EOF
CREDITS_PORT=5004
CREDITS_DB_HOST=localhost
CREDITS_DB_PORT=5432
CREDITS_DB_USER=credits_user
CREDITS_DB_PASSWORD=credits_pass
CREDITS_DB_NAME=credits
CREDITS_DB_SSL_MODE=disable
EOF

# Run database migrations before starting
# (The 'make migrate-up' command handles this)

# Run the service
go run cmd/server/main.go

See more: services/shieldx-credits/CREDITS-SERVICE.md

</details>


πŸ‘¨β€πŸ’» Development Guide

Project Structure

shieldx/
β”œβ”€β”€ services/          # Microservices
β”‚   β”œβ”€β”€ orchestrator/    # Central routing service
β”‚   β”œβ”€β”€ ingress/         # Gateway service
β”‚   β”œβ”€β”€ guardian/        # Sandbox service
β”‚   └── ...              # Other services
β”œβ”€β”€ shared/            # Shared Go libraries (common pkg, utils)
β”‚   └── shieldx-common/
β”œβ”€β”€ core/              # Core engines (policy, scoring, autoheal)
β”œβ”€β”€ infrastructure/    # Deployment configs (Docker, K8s, Terraform)
β”œβ”€β”€ docs/              # Project documentation
β”œβ”€β”€ tools/             # CLI tools and utilities
β”œβ”€β”€ tests/             # Integration and End-to-End tests
β”œβ”€β”€ .github/           # GitHub Actions workflows for CI/CD
β”œβ”€β”€ Makefile           # Automation for build, test, lint, run
└── README.md          # This file

Development Workflow

  1. Create a Feature Branch:
    git checkout -b feat/my-new-feature
  2. Develop: Write your code, add unit tests (aim for β‰₯70% coverage), and update relevant documentation.
  3. Test Locally: Use the Makefile to ensure quality before pushing.
    make fmt lint test
  4. Commit Changes: Follow the Conventional Commits specification.
    git commit -m "feat(auth): add password hashing mechanism"
  5. Push and Create a Pull Request:
    git push origin feat/my-new-feature
    Open a PR on GitHub, providing a clear description of your changes.

🀝 Contributing

We welcome contributions of all kinds! Your help is essential for making ShieldX a great security platform. Please read our Contributing Guide for detailed instructions.

How to Contribute

  1. Find an Issue: Check the open issues and look for labels like good first issue or help wanted.
  2. Discuss First: For major changes, please open an issue first to discuss your proposal.
  3. Submit a Pull Request: Fork the repository, create a feature branch, and submit a PR with your changes.

Contribution Areas

Area Examples
πŸ’» Code Implement new features, fix bugs, improve performance, increase test coverage.
πŸ“– Documentation Enhance API docs, write setup guides, create architecture diagrams, add code examples.
πŸ—οΈ Infrastructure Refine Docker/Kubernetes configurations, improve CI/CD pipelines, add monitoring dashboards.
πŸ›‘οΈ Security Perform security audits, report vulnerabilities privately, update the threat model.

πŸ§ͺ Testing

# Run all unit tests
make test

# Run tests with code coverage report
make test-coverage

# Run integration tests (requires Docker environment)
make test-integration

# Run end-to-end tests
make test-e2e

# Test OPA policies
cd policies
opa test . -v

Code Quality Tools

# Format all Go code
make fmt

# Run the linter to check for style issues and errors
make lint

# Run security vulnerability scans
make security-scan

πŸ“š Documentation

All key documentation is located in the /docs directory:


πŸ“Š Monitoring & Observability

  • Prometheus Metrics: All services export Prometheus-compatible metrics on their /metrics endpoint.
  • Grafana Dashboards: Pre-built dashboards are available in infrastructure/monitoring/grafana/.
  • Structured Logging: Services output structured JSON logs with a request_id for easy correlation.
  • Distributed Tracing: OpenTelemetry is integrated for end-to-end tracing.

πŸ†˜ Troubleshooting

Common Issues

  • Build Errors: Run go clean -cache -modcache, then go mod download && go mod verify, and finally make build.
  • Service Won't Start: Check service logs with docker logs <service-name>. Ensure required ports are not already in use.
  • Database Connection: Verify the infrastructure is running with docker ps. Test the connection manually if needed.
  • Guardian (Linux) Issues: Ensure you are running commands with sudo, that the KVM module is loaded (lsmod | grep kvm), and that your kernel version is 5.10+ (uname -r).

Getting Help


License

This project is licensed under the Apache License 2.0. See the LICENSE file for details.

Copyright Β© 2024-Present ShieldX Contributors.


Ready to build the future of cloud security?

Get Started Β· Read the Docs Β· Join Discussion Β· Report an Issue

If you find ShieldX useful, please give us a ⭐ to show your support!


About

ShieldX is an advanced cloud security platform that protects web applications and APIs from sophisticated cyber attacks through, in the process of detecting incomplete systems

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •