_____ _ _ _ _____ ______
/ ___ \ | | | | | | __ \ / _____)
| | | | ____ ____ ____ _ | | _ | | | | |__) ) /
| | | |/ _ |/ _ |/ _ ) || | (_) | | | | __ (| |
| |___| ( ( | ( ( | ( (_ | (_| | _ | |__| | | \ \ \_____
\_____/ \_||_|\_||_|\____\____| (_) \____/|_| |_|\______)
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.
- π 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.regorules 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.
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
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 ]
- Node.js:
v18.0.0or higher - NPM:
v9.0.0or higher
git clone https://github.com/Jean-Regis-M/AegisGRC.git
cd AegisGRC
npm installCreate 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!)
npm run devOpen http://localhost:3000 in your web browser to access the Aegis GRC Terminal.
Adding security controls to Aegis GRC is fast and structured:
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])
}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"]
}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:
- π¬ Custom OPA Policy Library: We want to broaden our
.regocatalog! Add rules protecting Google Cloud (GCP), Azure, Kubernetes configurations, and Dockerfiles. - π‘οΈ Additional Compliance Standards: Help us build coverage tables for PCI-DSS v4.0, HIPAA Safeguards, and FedRAMP Moderate criteria!
- π» Real-Time Integrations: Create plugins connecting our backend routes to Slack, Jira Tickets, and Webhooks.
- π 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!
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.
Aegis GRC is proudly distributed under the Apache License 2.0. Let's build a safer, more transparent compliance future together! π