Skip to content

opendefender/OpenRisk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

285 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

OpenRisk Logo

OpenRisk

Enterprise-Grade Risk Management Platform

Part of the OpenDefender Ecosystem

GitHub license GitHub release Go version React version


🎯 Overview

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

# 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

Default Credentials

Email: [email protected]
Password: admin123

πŸ›  Technical Stack

Backend

Component Technology Version
Language Go 1.25.4
Framework Fiber v2.52
Database PostgreSQL 16
ORM GORM v1.31
Testing Testify v1.11
Architecture CLEAN Domain-Driven

Frontend

Component Technology Version
Framework React 19.2.0
State Zustand 5.0.8
Styling Tailwind CSS 3.4.0
Forms React Hook Form 7.66
Routing React Router 7.9.6
Charts Recharts 3.5.0

Infrastructure

Component Technology Purpose
Containerization Docker Application packaging
Orchestration Kubernetes Production deployment
Charts Helm K8s configuration
CI/CD GitHub Actions Automated testing & deployment
Caching Redis Session & 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

Phase 5: Advanced Analytics βœ…

  • βœ… Analytics dashboard with real-time data
  • βœ… Risk heatmaps and trend analysis
  • βœ… Incident management system
  • βœ… Threat tracking and mapping
  • βœ… Gamification & engagement system

Phase 6: RBAC Frontend Enhancement πŸš€

  • πŸš€ Permission checking utilities (wildcard support, pattern matching)
  • πŸš€ Audit trail for compliance (event logging, filtering, export)
  • πŸš€ Performance optimization (permission caching with TTL)
  • πŸš€ Feature flag system (role-based feature enablement)
  • πŸš€ Comprehensive component library (10+ components)

πŸ“š Documentation

Document Purpose
LOCAL_DEVELOPMENT.md Setup guide for development environment
API_REFERENCE.md Complete API endpoint documentation
KUBERNETES_DEPLOYMENT.md K8s deployment instructions
PRODUCTION_RUNBOOK.md Production operations guide
INTEGRATION_TESTS.md Testing procedures
SAML_OAUTH2_INTEGRATION.md SSO integration guide
SYNC_ENGINE.md Integration sync documentation
RBAC_FRONTEND_COMPONENTS_GUIDE.md Frontend RBAC components & hooks
RBAC_PHASE3_COMPREHENSIVE_SUMMARY.md Phase 3 implementation details
ADVANCED_PERMISSIONS.md RBAC & 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

# Run all tests
make test-all

# Backend unit tests
cd backend && go test ./...

# Frontend tests
cd frontend && npm test

# Integration tests
./scripts/run-integration-tests.sh

Test Statistics: 142+ tests passing βœ…


πŸ“Š 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 with expiration
  • Authorization: RBAC with permission matrices
  • Encryption: SHA256 hashing for sensitive data
  • Audit: Complete audit trail for all operations
  • SSO: OAuth2 and SAML2 support
  • Rate Limiting: API rate limiting middleware
  • Input Validation: Request validation with Zod/validator

See ADVANCED_PERMISSIONS.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

Shortcut Action Context
⌘K or Ctrl+K Open global search Anywhere in the app
⌘N or Ctrl+N Create new risk Dashboard and Risks page
Esc Close modal/dialog Any open modal or dialog

Search & Navigation

Shortcut Action Context
↑ Previous search result In search suggestions
↓ Next search result In search suggestions
Enter Select search result Search suggestions open
Esc Close search dropdown Search suggestions open

Risk Management

Shortcut Action Context
Esc Close risk details Risk details panel open
Esc Close edit modal Risk 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 licensed under the MIT License - see the LICENSE file for details.


πŸ™‹ Support & Contact


🌟 Roadmap

Q1 2026 - RBAC Frontend βœ… (In Progress)

  • βœ… Permission gate components & hooks
  • βœ… Route-level permission guards
  • βœ… Role & tenant management pages
  • βœ… Audit logging system
  • βœ… Permission caching optimization
  • πŸš€ Code review & testing phase

Q2 2026

  • Multi-tenant advanced features
  • Permission analytics dashboard
  • Role templates & bulk operations
  • Mobile application (React Native)

Q3 2026

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

Q4 2026

  • Enterprise audit compliance
  • Advanced analytics engine
  • Custom dashboard builder
  • Workflow automation

πŸ‘₯ Credits

OpenRisk is developed and maintained by the OpenDefender community.


πŸ“ž Questions?


Made with ❀️ by OpenDefender Community

⭐ Star us on GitHub