Skip to content

Latest commit

History

1,399 Commits

Folders and files

NameName
Last commit message
Last commit date
OpenRisk Logo

OpenRisk

Enterprise-Grade Risk Management Platform

Part of the OpenDefender Ecosystem

License: AGPL v3GitHub releaseGitHub Actions CI/CDGo versionReact version


🎬 Demo Visuelle

OpenRisk Demo

Pour voir la démonstration complète en vidéo, consultez la section "Support & Contact" ci-dessous.


🎯 Vue d'ensemble

OpenRisk is a modern, enterprise-grade Risk Management Platform that transforms how organizations identify, assess, mitigate, and monitor risks. Built with a scalable microservices architecture, OpenRisk enables teams to move beyond spreadsheets and legacy systems into a seamless, automated risk management experience.

🎯 What OpenRisk Enables

OpenRisk allows every organization to:

  • Identify IT & security risks
  • Score & Prioritize risks based on impact and probability
  • Track mitigation plans and action items
  • Monitor trends in real-time with interactive dashboards

💡 Designed For

  • CTO & CISO - Strategic risk oversight and compliance
  • DevSecOps - Integrated security in CI/CD pipelines
  • Security Analysts - Risk assessment and investigation
  • Compliance Teams - Audit trails and governance

📈 Key Advantages

  • Automated Risk Assessment - Reduce manual evaluation time
  • 📊 Interactive Dashboards - Real-time risk visualization
  • 🔌 Native Integrations - Elastic, Splunk, TheHive, OpenCTI, AWS
  • 🐳 Easy Deployment - Docker & Kubernetes ready
  • 🔐 Enterprise Security - RBAC, SSO, audit logging
  • 📈 Scalable Architecture - Microservices-ready

Key Capabilities

  • 🎲 Risk Assessment - Comprehensive risk identification and scoring
  • 🛡️ Mitigation Tracking - Monitor and track risk mitigations in real-time
  • 📊 Advanced Analytics - Real-time dashboards and trend analysis
  • 🔐 Enterprise Security - RBAC, audit logging, OAuth2/SAML2 SSO
  • 🔌 Integration Ready - TheHive, OpenCTI, Splunk, Elastic connectors
  • ⚙️ Custom Fields - Flexible schema for organizational needs
  • 📈 Gamification - Engagement and incentive system

🚀 Quick Start (5 Minutes)

Prerequisites

  • Docker & Docker Compose
  • Git
  • 4GB RAM, 2GB disk space

Local Development

# Clone the repository
git clone https://github.com/opendefender/OpenRisk.git
cd OpenRisk
# Create .env file with secure credentials
cat > .env.local << 'EOF'# Admin Account (customize these values)INITIAL_ADMIN_EMAIL=admin@yourdomain.comINITIAL_ADMIN_PASSWORD=<YOUR_SECURE_PASSWORD_HERE># JWT ConfigurationJWT_SECRET=<YOUR_JWT_SECRET_HERE>JWT_EXPIRATION_HOURS=24# DatabaseDATABASE_URL=postgresql://openrisk:secure_password@postgres:5432/openriskREDIS_URL=redis://redis:6379# APIAPI_PORT=8080API_HOST=0.0.0.0EOF# Start all services (PostgreSQL, Redis, Backend, Frontend)
docker compose up -d
# Access the application# Frontend: http://localhost:5173# Backend API: http://localhost:8080# API Docs: http://localhost:8080/swagger# Login with credentials from .env.local

⚠️ Security: Default Credentials

NEVER use default/hardcoded credentials in production!

  1. Always create strong, unique passwords
  2. Use environment variables (.env files) - never commit them to Git
  3. Add .env.local to your .gitignore
  4. Rotate credentials regularly in production
  5. Use a secrets management solution (Vault, AWS Secrets Manager, etc.)

Password Requirements (enforced server-side at registration):

  • Minimum 12 characters
  • At least three of: lowercase, uppercase, digits, symbols
  • Common and predictable passwords are rejected
  • Preferably generated with a password manager (1Password, Bitwarden, etc.)

🛠 Technical Stack

Backend

ComponentTechnologyVersion
LanguageGo1.25.4
FrameworkFiberv2.52
DatabasePostgreSQL16
ORMGORMv1.31
TestingTestifyv1.11
ArchitectureCLEANDomain-Driven

Frontend

ComponentTechnologyVersion
FrameworkReact19.2.0
StateZustand5.0.8
StylingTailwind CSS3.4.0
FormsReact Hook Form7.66
RoutingReact Router7.9.6
ChartsRecharts3.5.0

Infrastructure

ComponentTechnologyPurpose
ContainerizationDockerApplication packaging
OrchestrationKubernetesProduction deployment
ChartsHelmK8s configuration
CI/CDGitHub ActionsAutomated testing & deployment
CachingRedisSession & cache layer

📋 Features

Phase 1: Core Risk Management ✅

  • ✅ Risk CRUD operations (Create, Read, Update, Delete, List)
  • ✅ Risk scoring engine with weighted calculations
  • ✅ Mitigation tracking with checklist sub-actions
  • ✅ Asset management and relationships
  • ✅ Soft-delete support with audit trails

Phase 2: Security & Authentication ✅

  • ✅ JWT-based authentication
  • ✅ API Token management (create, revoke, rotate)
  • ✅ Role-Based Access Control (RBAC) - Backend (37+ endpoints, 11 domain models)
  • ✅ Permission matrices (resource-level granularity)
  • ✅ Comprehensive audit logging
  • ✅ OAuth2/SAML2 SSO (Google, GitHub, Azure AD)

Phase 3: Infrastructure & Deployment ✅

  • ✅ Docker Compose local development
  • ✅ GitHub Actions CI/CD pipeline
  • ✅ Integration test suite
  • ✅ Kubernetes Helm charts
  • ✅ Staging & production runbooks

Phase 3.5: RBAC Frontend Implementation ✅

  • ✅ Permission gate components (7 reusable wrappers)
  • ✅ Route-level permission guards (4 types)
  • ✅ Role & Tenant management pages (admin interfaces)
  • ✅ Advanced RBAC utilities (35+ functions)
  • ✅ Audit logging system (compliance tracking)
  • ✅ Permission caching (performance optimization)
  • ✅ Custom React hooks (usePermissions, useAuditLog)
  • ✅ Comprehensive documentation (2,000+ lines)

Phase 4: Enterprise Features ✅

  • ✅ Custom fields framework (5 types)
  • ✅ Bulk operations with validation
  • ✅ Risk timeline (audit trail)
  • ✅ Advanced reporting & export
  • ✅ SSO integration (OAuth2/SAML2)

Phase 5: Performance Optimization & Comprehensive Testing ✅

Performance Optimization:

  • ✅ Redis caching layer (generic CacheService, TTL management)
  • ✅ Query optimization (7 GORM patterns, N+1 elimination)
  • ✅ Database indexing (70+ strategic indexes, 100x+ faster)
  • ✅ Load testing framework (k6 baseline, 50+ concurrent users)

Testing & Validation:

  • ✅ Integration tests (8 test cases, 312 lines, CRUD + concurrency)
  • ✅ E2E tests with Playwright (12+ scenarios, 5 browsers/viewports)
  • ✅ Security testing (11 categories, SQL injection/XSS/CSRF/auth)
  • ✅ Performance benchmarks (9 benchmarks, all targets met)
  • ✅ Docker Compose testing infrastructure (9 services, isolated env)
  • ✅ Comprehensive testing guide (529 lines, CI/CD examples)

Performance Targets Met:

  • Risk creation > 100 ops/sec ✅
  • Risk retrieval > 500 ops/sec ✅
  • Cache operations > 1000 ops/sec ✅
  • Dashboard load < 3 seconds ✅
  • Risk list (100 items) < 5 seconds ✅

Phase 6: Advanced Analytics & Monitoring 🚀

  • 🚀 Analytics dashboard with real-time data
  • 🚀 Risk heatmaps and trend analysis
  • 🚀 Incident management system
  • 🚀 Threat tracking and mapping
  • 🚀 Gamification & engagement system
  • 🚀 Performance monitoring & alerting

📚 Documentation

DocumentPurpose
TESTING_GUIDE.mdComplete testing procedures & execution guide
TESTING_COMPLETION_SUMMARY.mdPhase 5 testing overview & metrics
OPTIMIZATION_REPORT.mdPerformance optimization strategies & analysis
PERFORMANCE_TESTING.mdk6 load testing configuration & guide
LOCAL_DEVELOPMENT.mdSetup guide for development environment
API_REFERENCE.mdComplete API endpoint documentation
KUBERNETES_DEPLOYMENT.mdK8s deployment instructions
PRODUCTION_RUNBOOK.mdProduction operations guide
SAML_OAUTH2_INTEGRATION.mdSSO integration guide
ADVANCED_PERMISSIONS.mdRBAC & permissions documentation

For more documentation, see the docs directory.


🚀 Deployment

Local Development

docker compose up -d

Staging Environment

# See docs/STAGING_DEPLOYMENT.md
./scripts/deploy-kubernetes.sh --environment staging

Production Deployment

# See docs/PRODUCTION_RUNBOOK.md
helm install openrisk ./helm/openrisk \
-f helm/values-prod.yaml \
--namespace openrisk

🧪 Testing & Quality Assurance

Test Suites Available

Integration Tests - Database-level testing with PostgreSQL & Redis

go test -v ./tests/integration_test.go -timeout 30m
  • 8 test cases covering CRUD, relationships, concurrency
  • Query performance validation
  • Audit logging verification

E2E Tests - User workflows in real browsers with Playwright

npx playwright test [--headed] [--project=chromium|firefox|webkit]
npx playwright show-report
  • 12+ test scenarios across 5 browsers/viewports
  • Authentication, risk management, custom fields
  • Mobile responsiveness (iPhone 12, Pixel 5)
  • Performance metrics validation

Security Tests - Vulnerability scanning and protection verification

go test -v ./tests/security_test.go -timeout 30m
  • CSRF protection, SQL injection prevention
  • XSS protection, rate limiting, auth bypass detection
  • Security headers validation, CORS verification

Performance Benchmarks - Throughput and latency measurements

go test -v -bench=. ./tests/performance_benchmark_test.go -timeout 30m
  • 9 benchmarks covering all critical operations
  • Cache vs database performance comparison
  • Concurrent operation handling

Docker Compose Testing - Isolated test environment

docker-compose -f docker-compose.test.yaml up -d
docker-compose -f docker-compose.test.yaml run integration_tests
docker-compose -f docker-compose.test.yaml run security_tests
docker-compose -f docker-compose.test.yaml run performance_tests
docker-compose -f docker-compose.test.yaml run e2e_tests
docker-compose -f docker-compose.test.yaml down -v

Test Statistics

  • 30+ test cases across all test suites
  • 2,707 lines of test code
  • 11 security categories (OWASP coverage)
  • 9 performance benchmarks (all targets met)
  • 5 browser/viewport combinations

See TESTING_GUIDE.md and TESTING_COMPLETION_SUMMARY.md for detailed testing documentation.


📊 API Overview

OpenRisk provides a comprehensive REST API with 37+ endpoints:

Core Endpoints

POST /api/risks - Create risk
GET /api/risks - List risks
GET /api/risks/:id - Get risk details
PATCH /api/risks/:id - Update risk
DELETE /api/risks/:id - Delete risk
POST /api/mitigations - Create mitigation
GET /api/mitigations - List mitigations
PATCH /api/mitigations/:id - Update mitigation
POST /api/mitigations/:id/sub-actions - Add checklist item
PATCH /api/mitigations/:id/sub-actions/:aid - Toggle completion

RBAC & Security

POST /auth/login - JWT authentication
POST /auth/register - User registration
POST /auth/oauth2/:provider - OAuth2 login
POST /auth/saml/acs - SAML assertion endpoint
GET /api/tokens - List API tokens
POST /api/tokens - Create new token
DELETE /api/tokens/:id - Revoke token
GET /rbac/roles - List roles
POST /rbac/roles - Create role
PUT /rbac/roles/:id - Update role
DELETE /rbac/roles/:id - Delete role
GET /rbac/permissions - List permissions
GET /rbac/tenants - List tenants
POST /rbac/tenants - Create tenant
GET /rbac/tenants/:id/stats - Tenant statistics
DELETE /rbac/tenants/:id - Delete tenant

Analytics & Reporting

GET /api/analytics/dashboard - Dashboard metrics
GET /api/analytics/trends - Risk trends
GET /api/reports - List reports
POST /api/reports/export - Export risks/mitigations

See API_REFERENCE.md for complete endpoint documentation with examples.


🔐 Security

OpenRisk implements enterprise-grade security:

  • Authentication: JWT tokens (RS256) with expiration and JTI blacklist
  • Authorization: RBAC with permission matrices and resource-level granularity
  • Password Hashing: Argon2id (m=64MB, t=3, p=4) - never SHA256 or bcrypt alone
  • Encryption: AES-256-GCM for sensitive data at rest
  • Audit Trail: Complete audit logging for all operations (append-only)
  • SSO: OAuth2 (Google, GitHub) and SAML2 support
  • Rate Limiting: Per-IP and per-tenant quotas across the API, with a stricter throttle on credential endpoints
  • Security Headers: CSP, HSTS, X-Frame-Options, Referrer-Policy and nosniff
  • Input Validation: Server-side request validation (go-playground/validator); Zod on the frontend
  • Default Credentials: Never hardcoded - always use environment variables
  • Secrets Management: Support for external secret managers (Vault, AWS Secrets Manager)

⚠️Security Best Practices:

  • Rotate credentials and API keys regularly
  • Use strong passwords (12+ characters, mixed case, numbers, symbols)
  • Enable MFA/2FA for all user accounts
  • Keep dependencies updated regularly
  • Run security scans (TruffleHog, Snyk, Trivy)
  • Monitor audit logs for suspicious activity

See ADVANCED_PERMISSIONS.md and SECURITY.md for detailed security documentation.


⌨️ Keyboard Shortcuts

OpenRisk includes keyboard shortcuts to help you work faster. Below is a complete list of available shortcuts:

Global Shortcuts

ShortcutActionContext
⌘K or Ctrl+KOpen global searchAnywhere in the app
⌘N or Ctrl+NCreate new riskDashboard and Risks page
EscClose modal/dialogAny open modal or dialog

Search & Navigation

ShortcutActionContext
Previous search resultIn search suggestions
Next search resultIn search suggestions
EnterSelect search resultSearch suggestions open
EscClose search dropdownSearch suggestions open

Risk Management

ShortcutActionContext
EscClose risk detailsRisk details panel open
EscClose edit modalRisk editing modal open

Tips for Power Users

  • Search Tip: Use ⌘K / Ctrl+K from anywhere to quickly search for risks, assets, or mitigations
  • Quick Create: Press ⌘N / Ctrl+N on the dashboard to rapidly create new risks
  • Navigation: Use arrow keys in search results to navigate without your mouse
  • Mobile: These shortcuts work best on desktop/laptop keyboards

Planned Shortcuts (Coming Soon)

  • Edit Last Risk - ⌘E / Ctrl+E
  • Filter Results - ⌘F / Ctrl+F
  • Delete Selected - ⌘D / Ctrl+D
  • Focus Search - / key
  • Settings - ⌘, / Ctrl+,

🤝 Contributing

We welcome contributions from the community! Please see CONTRIBUTING.md for guidelines.

Development Workflow

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📝 License

OpenRisk is open-core:

  • Community Edition (the core GRC platform) — GNU AGPL v3.0 (LICENSE). Free to self-host, study, modify and redistribute. The AGPL's network clause means anyone running a modified core as a hosted service must publish their changes under the AGPL.
  • Enterprise Edition (advanced SSO, AI copilot, premium connectors & SOAR, multi-organisation management) — OpenRisk Commercial License (LICENSE.commercial), used under a paid subscription.
  • The design system (frontend/design-system/ and frontend/src/shared/ds/) — Apache License 2.0 (frontend/design-system/LICENSE). Deliberately permissive: the tokens and primitives are meant to be copied and extended, including by commercial code. Attribution lives in NOTICE. Apache-2.0 grants no trademark rights — the OpenRisk and OpenDefender names and logos are not licensed by it.

Every source file declares its edition via its SPDX-License-Identifier header (AGPL-3.0-only, LicenseRef-OpenRisk-Commercial or Apache-2.0). The authoritative boundary between the three is LICENSING.md.

For commercial licensing: licensing@opendefender.io


🙋 Support & Contact


📋 Audit & Verification Reports

Phase 6C Pre-Launch Audit (March 10, 2026) - Complete project assessment before SaaS deployment:

Comprehensive Analysis Available

  • 📊 COMPREHENSIVE_AUDIT_REPORT.md - Executive summary with 8 analysis dimensions:

    • Performance Analysis (Score: 8/10)
    • Architecture & Design Patterns (Score: 9/10)
    • Security Audit (Score: 9/10)
    • Code Quality Assessment (Score: 8/10)
    • Documentation Review (50+ files)
    • Testing Coverage (28 test files, ~40%)
    • Dependency Analysis (50+ total dependencies)
    • Zero AI/ML patterns detected ✅
  • 🎯 RISK_REGISTER_FEATURES_ANALYSIS.md - Core feature verification:

    • ✅ 13/13 Risk Register features confirmed present
    • ✅ All 4 visualization types implemented
    • ✅ Custom fields & templates working
    • ✅ Bulk operations (UPDATE, DELETE, ASSIGN, EXPORT)
    • ✅ Audit trail & timeline tracking
    • ✅ Search, filtering & sorting
    • Status: 95% COMPLETE & PRODUCTION READY
  • 🔍 ANALYSIS_INDEX.md - Navigation hub for all audit documents with quick metrics

  • COMPLETION_SUMMARY.md - Final verdict & next steps

New Feature: Advanced Typeahead Search 🆕

  • Implementation: Complete typeahead hook with fuzzy matching algorithm
  • Features:
    • Keyboard shortcuts (Cmd+K, Cmd+/, ↑↓, Enter, Esc)
    • Fuzzy match scoring (0-1 relevance ranking)
    • Recent searches (localStorage-backed)
    • Command palette with global actions
  • Status: ✅ Production-ready
  • Documentation: ADVANCED_TYPEAHEAD_IMPLEMENTATION.md

🌟 Roadmap

Q1 2026 - Phase 5: Performance Optimization & Testing ✅ COMPLETE

  • ✅ Redis caching layer implementation
  • ✅ Query optimization (N+1 elimination)
  • ✅ Database indexing (70+ indexes)
  • ✅ Integration test suite (8 tests)
  • ✅ E2E tests with Playwright (12+ scenarios)
  • ✅ Security testing suite (11 categories)
  • ✅ Performance benchmarking (9 benchmarks)
  • ✅ Docker Compose testing infrastructure
  • ✅ Comprehensive testing documentation
  • ✅ All performance targets met (100-1000 ops/sec)

Q2 2026 - Phase 6: Advanced Analytics & Monitoring

  • 🚀 Real-time analytics dashboard
  • 🚀 Risk trend analysis
  • 🚀 Incident management
  • 🚀 Performance monitoring & alerting
  • 🚀 Gamification system

Q3 2026

  • Advanced RBAC enhancements
  • Additional connector integrations
  • Machine learning risk predictions
  • API webhook support

Q4 2026

  • Enterprise audit compliance
  • Custom dashboard builder
  • Workflow automation
  • Multi-tenant advanced features

👥 Credits

OpenRisk is developed and maintained by the OpenDefender community.


📞 Questions?


Made with ❤️ by OpenDefender Community

⭐ Star us on GitHub