Skip to content

Jean-Regis-M/AegisGRC

πŸ›‘οΈ Aegis GRC β€” AI-Powered Policy-as-Code & Drift Healing Compliance Platform

       _____                       _        _    _ _____   ______ 
      / ___ \                     | |      | |  | |  __ \ / _____)
     | |   | | ____  ____  ____ _ | |  _   | |  | | |__) ) /      
     | |   | |/ _  |/ _  |/ _  ) || | (_)  | |  | |  __ (| |      
     | |___| ( ( | ( ( | ( (_ | (_| |  _   | |__| | |  \ \ \_____ 
      \_____/ \_||_|\_||_|\____\____| (_)   \____/|_|  |_|\______)
                                                                  
      CONTINUOUS INFRASTRUCTURE ASSURANCE & CONTINUOUS COMPLIANCE ENGINE

Aegis GRC is a production-level, open-source continuous assurance and compliance platform. It bridges the gap between infrastructure deployment (IaC) and regulatory standards (SOC2 Type II, ISO/IEC 27001:2022, and NIST CSF v2.0). By compiling your cloud configurations to AST formats, checking them against automated Open Policy Agent (OPA) Web Decider policies, and enriching findings with server-side AI, Aegis empowers security engineering teams to detect, triage, and automatically heal security gaps before they hit production.


πŸš€ Key Architectural Capabilities

  • πŸ” Multi-Level IaC AST Scanner: Evaluates Terraform manifests with an abstract syntax tree parser to find security misconfigurations (S3 unencrypted buckets, global ingress administrative ports, unencrypted EBS drives, etc.).
  • πŸ›‘οΈ Open Policy Agent (OPA) Integration: Built-in OPA engine that compiles and parses declarative policies/soc2/cc6_1.rego rules down to nanosecond-speed evaluation frames.
  • ⚑ Closed-Loop Drift Healing: Continuous out-of-band state comparison that identifies drift from declared resources and features a single-click self-healing "Heal Boundary" pipeline.
  • πŸ€– Server-Side AI Co-Pilot & Triage: Uses Gemini models to construct precise, high-fidelity security explanations, risk mitigation plans, active code fixes, and cryptographic GRC certifications.
  • πŸ“‘ Dynamic PDF Report Architect: Backend compilation route producing beautiful, audit-ready regulatory attestation documents on-the-fly containing score widgets, risk formulas, active findings, and full timeline logs.
  • πŸ’» DevOps Terminal & Ledger Timeline: Fully reactive diagnostic audit ledger tracking system startups, ad-hoc scans, pipeline triggers, and self-healing events.

πŸ—οΈ Detailed Project Directory Structure

The repository represents a unified multi-environment full-stack system containing both the real-time React/Express interactive Web Console and the nested Enterprise Python/FastAPI OPA microservice daemon (/aegisgrc/ folder):

AegisGRC/
β”œβ”€β”€ src/                         # 🎨 Front-End: Modern React + Vite Web Console
β”‚   β”œβ”€β”€ App.tsx                  # Core interactive desktop dashboard & control loops
β”‚   β”œβ”€β”€ types.ts                 # Strong TypeScript interface & compliance definitions
β”‚   β”œβ”€β”€ repoFiles.ts             # Static code store rendering virtual HCL/Rego browser files
β”‚   β”œβ”€β”€ index.css                # Global Tailwind CSS & typography definitions
β”‚   └── main.tsx                 # Vite application mount point
β”œβ”€β”€ aegisgrc/                    # 🐍 Backend: Enterprise Python + OPA Policy Microservice
β”‚   β”œβ”€β”€ .github/workflows/       # Continuous Integration and compliance verification YAMLs
β”‚   β”‚   β”œβ”€β”€ ci.yml               # Automated Python code formatting and pytest workflow
β”‚   β”‚   └── compliance-scan.yml  # Daily periodic OPA cloud assurance scan schedule
β”‚   β”œβ”€β”€ api/                     # FastAPI backend boundary layers
β”‚   β”‚   β”œβ”€β”€ main.py              # Microservice application entrance & router mapping
β”‚   β”‚   β”œβ”€β”€ dependencies.py      # Auth handlers, api-key validators, database sessions
β”‚   β”‚   β”œβ”€β”€ routers/             # Endpoint definitions
β”‚   β”‚   β”‚   └── scans.py         # Handles HCL AST uploads, triggering parser & scoring
β”‚   β”‚   └── schemas/             # Typed request/response validator schemas (Pydantic)
β”‚   β”‚       └── scan.py          # Unified scan execution request-response structures
β”‚   β”œβ”€β”€ core/                    # Platform constants and cross-module utilities
β”‚   β”‚   β”œβ”€β”€ config.py            # Environment-safe configuration parsers
β”‚   β”‚   β”œβ”€β”€ exceptions.py        # Centralized exception tracking classes
β”‚   β”‚   └── logging.py           # Configured system log formatters
β”‚   β”œβ”€β”€ db/                      # GRC session SQL persistence managers (SQLAlchemy)
β”‚   β”‚   β”œβ”€β”€ base.py              # Declarative schema base mapping definitions
β”‚   β”‚   β”œβ”€β”€ models.py            # DB schema definitions (ScanReports, LedgerHistory)
β”‚   β”‚   └── session.py           # Thread-safe database connection session managers
β”‚   β”œβ”€β”€ engine/                  # Core parsing, evaluation, and rating algorithms
β”‚   β”‚   β”œβ”€β”€ ai_evidence.py       # Intercepts scan logs to build Gemini attestation drafts
β”‚   β”‚   β”œβ”€β”€ opa.py               # Spawns sub-processes communicating directly with OPA CLI
β”‚   β”‚   β”œβ”€β”€ parser.py            # Converts raw HCL elements into parsed operational JSON ASTs
β”‚   β”‚   └── scorer.py            # Weights control risks (L x I x E) to derive ratings
β”‚   β”œβ”€β”€ policies/soc2/           # Pre-loaded Policy-as-Code criteria definitions
β”‚   β”‚   β”œβ”€β”€ cc6_1.rego           # OPA Rego rules evaluating raw AWS network configurations
β”‚   β”‚   └── mapping.json         # Connects OPA rule codes directly to SOC2 common criteria
β”‚   β”œβ”€β”€ terraform/               # Sample templates used in static scanners or mock pipelines
β”‚   β”‚   └── sample_infra.tf      # Intentional policy-violating HCL blueprint sample
β”‚   β”œβ”€β”€ tests/                   # Service assurance tests suite (pytest)
β”‚   β”‚   β”œβ”€β”€ test_api.py          # Validates scan submission and health response structures
β”‚   β”‚   └── test_engine.py       # Runs test-assertions over parsers and score calculations
β”‚   β”œβ”€β”€ Dockerfile               # Production multi-stage Docker container specification
β”‚   β”œβ”€β”€ docker-compose.yml       # Quick-spin container sandbox orchestrator
β”‚   β”œβ”€β”€ README.md                # Python backend microservice documentation
β”‚   β”œβ”€β”€ ARCHITECTURE.md          # Architectural and threat mitigation specifications
β”‚   β”œβ”€β”€ COMPLIANCE_MAPPING.md    # Detail maps tracing policies directly to AICPA criteria
β”‚   β”œβ”€β”€ SECURITY.md              # Vulnerability capture procedures for backend operations
β”‚   β”œβ”€β”€ CONTRIBUTING.md          # Guide for python & policy contributors
β”‚   └── THREAT_MODEL.md          # Architectural threat models and boundaries
β”œβ”€β”€ server.ts                    # ⚑ Middle-Tier: High-fidelity Node + Express Server
β”‚   # (Executes AST parses, proxies secure Gemini actions, generates GRC PDF report artifacts)
β”œβ”€β”€ package.json                 # Project dependencies & startup scripting configurations
β”œβ”€β”€ CONTRIBUTING.md              # Global developer and code of conduct playbook
β”œβ”€β”€ SECURITY.md                  # Global security vulnerability reporting guides
└── README.md                    # Primary repository landing page & roadmap guide

πŸ”„ Automated Compliance Lifecycle

The platform runs a continuous control loop that orchestrates verification:

  [ Dev Commit / Pull Request ]
               β”‚
               β–Ό
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚ AST Attribute Parser  β”‚  <── Parses HCL input to structured JSON context
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚
               β–Ό
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚ OPA Evaluation Engine β”‚  <── Validates against policies/soc2/cc6_1.rego
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚
               β–Ό
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚ Risk Scoring System   β”‚  <── Calculates Risk = Impact x Likelihood x Exposure
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚
               β–Ό
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚ Gemini AI Enrichment  β”‚  <── Generates secure code fixes & attestation stamps
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚
               β–Ό
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚   Audit Trail Log     β”‚  <── Commits actions atomically to telemetry ledger
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚
               β–Ό
 [ Beautiful Interactive Dashboard / PDF Downloadable Attestation Report ]

βš™οΈ Requirements & Quick Start

Prerequisites

  • Node.js: v18.0.0 or higher
  • NPM: v9.0.0 or higher

1. Clone & Install Dependencies

git clone https://github.com/Jean-Regis-M/AegisGRC.git
cd AegisGRC
npm install

2. Configure Environment Secrets

Create a .env file at the root of the project:

# Define your Gemini API Credentials for AI Attestation & Interactive GRC Chat
GEMINI_API_KEY="AIzaSyYourSecretKeyHeaderGoesHere"

(If the API Key is absent or rate-limited, Aegis gracefully transitions into an intelligent offline local backup mode with pre-baked high-fidelity compliance metrics!)

3. Launch Development Server

npm run dev

Open http://localhost:3000 in your web browser to access the Aegis GRC Terminal.


πŸ› οΈ How to Add Your Own OPA Compliance Policies

Adding security controls to Aegis GRC is fast and structured:

Step 1: Write your Rego Rule

Add a new violation criteria in policies/soc2/cc6_1.rego:

violation[msg] {
    some resource
    resource.type == "aws_db_instance"
    not resource.attributes.storage_encrypted
    msg := sprintf("SOC2 CC6.3 Violation: DB Instance '%s' has storage encryption disabled.", [resource.name])
}

Step 2: Map to GRC Controls

Register your new OPA rule inside code mappings to display it cleanly in dashboard summaries and mapping tables:

"CC6.3": {
  "title": "Encryption of Data at Rest",
  "description": "Verifies static database instances and media buckets enforce KMS custom keys.",
  "rego_rules": ["is_unencrypted_db_instance", "is_unencrypted_s3_bucket"]
}

🀝 For Contributors: Making a Real Impact

Aegis GRC is built by security engineers, for security engineers. We are fiercely committed to building the finest open-source compliance shield. Here is where we need your talent:

  1. πŸ”¬ Custom OPA Policy Library: We want to broaden our .rego catalog! Add rules protecting Google Cloud (GCP), Azure, Kubernetes configurations, and Dockerfiles.
  2. πŸ›‘οΈ Additional Compliance Standards: Help us build coverage tables for PCI-DSS v4.0, HIPAA Safeguards, and FedRAMP Moderate criteria!
  3. πŸ’» Real-Time Integrations: Create plugins connecting our backend routes to Slack, Jira Tickets, and Webhooks.
  4. πŸ“Š Rich Data Visualizations: We love maps, charts, and clean bento grids! Introduce additional D3/Recharts modules inside our main screen.

To start contributing, please review our detailed CONTRIBUTING.md!


πŸ”’ Security Vulnerability Handling

We take platform security with extreme seriousness. If you identify a structural vulnerability or key-leak, please do not create a public GitHub Issue. Instead, read our SECURITY.md guidelines and report it directly to security@aegisgrc.enterprise so we can coordinate a secured private fix.

πŸ“„ Licensing & Open Source Spirit

Aegis GRC is proudly distributed under the Apache License 2.0. Let's build a safer, more transparent compliance future together! πŸš€

About

AI-powered Policy-as-Code GRC platform that continuously scans Terraform infrastructure, maps controls to SOC2 requirements, evaluates compliance with Open Policy Agent (OPA), and automatically generates audit-ready evidence using LLM workflows.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors