System Architecture
Arsitektur Microservices
Centralize Management System menggunakan arsitektur microservices dengan Docker Compose untuk mengelola log, security alerts, dan audit trail secara terpusat.
Container Architecture
┌─────────────────────────────────────────────────────────────────────────┐
│ Docker Network: monitoring │
│ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Keycloak │ │ CLM Backend │ │ Fluentd │ │
│ │ (Auth) │───▶│ (Go API) │───▶│ (Log Ship) │ │
│ │ :8080 │ │ :8081 │ │ :24224 │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
│ │ ▲ │
│ ▼ │ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────┐│
│ │ audit-log-* │ │ Fluent Bit │ │OpenSearch││
│ │ (OpenSearch) │ │ (Collector) │ │ (Storage)││
│ └──────────────┘ │ :2020 │ │ :9200 ││
│ └──────────────┘ └──────────┘│
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Wazuh Agent │───▶│Wazuh Manager │───▶│ alerts.json │ │
│ │ (per server) │ │ :1514/:55000│ │ (volume) │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
└─────────────────────────────────────────────────────────────────────────┘
Backend Go Architecture
Backend menggunakan Go 1.23 dengan standard library net/http:
backend/
├── cmd/api/main.go # Entry point
├── internal/
│ ├── config/config.go # Environment-based configuration
│ ├── server/
│ │ └── server.go # Route definitions, middleware
│ ├── handlers/ # HTTP handlers (11 modules)
│ │ ├── alerts.go
│ │ ├── dashboard.go
│ │ ├── logaudit.go
│ │ ├── monitoring.go
│ │ ├── monitors.go
│ │ ├── telegram.go
│ │ ├── infra.go
│ │ ├── servicemap.go
│ │ ├── k8s.go
│ │ ├── camel.go
│ │ └── healthcheck.go
│ ├── keycloak/ # Keycloak JWT verification
│ ├── opensearch/ # OpenSearch client
│ ├── database/ # PostgreSQL client
│ └── prometheus/ # Prometheus client
├── migrations/ # SQL migrations
├── docs/ # Swagger docs
└── Makefile # Build commands
Frontend Architecture
Frontend menggunakan React 19 + TypeScript + Vite:
frontend/src/
├── api/ # API client modules
│ ├── auth.ts
│ ├── logs.ts
│ ├── http.ts # Core fetch wrapper
│ ├── service.ts
│ └── rbac.ts
├── components/
│ ├── ui/ # shadcn/ui primitives (46 components)
│ ├── sidebar.tsx
│ ├── header.tsx
│ └── charts/
├── data/ # Static data (roles, compliance)
├── hooks/ # Custom React hooks
├── lib/
│ ├── app-context.tsx # Auth state, tenant management
│ ├── utils.ts
│ └── types.ts
├── routes/ # Page components (12 pages)
├── router.tsx # React Router v7 config
├── app.tsx # Root app component
├── main.tsx # React root mount
├── i18n.ts # Internationalization
└── styles.css # Tailwind CSS styles
Core Banking Architecture
Core Banking menggunakan Java 17 + Spring Boot 3.2:
core-banking/src/main/java/
├── com/banking/
│ ├── controller/ # REST controllers
│ ├── service/ # Business logic
│ ├── repository/ # JPA repositories
│ ├── entity/ # JPA entities
│ ├── dto/ # Data transfer objects
│ ├── security/ # JWT, Spring Security config
│ └── websocket/ # STOMP WebSocket handlers
Technology Details
Backend Stack
| Component | Technology | Version |
|---|---|---|
| Language | Go | 1.23 |
| HTTP Router | net/http (stdlib) | - |
| API Docs | swaggo | - |
| Auth | Keycloak JWT | - |
| Database | PostgreSQL (lib/pq) | 16 |
| Search | OpenSearch | 3.7 |
| Metrics | Prometheus client | - |
Frontend Stack
| Component | Technology | Version |
|---|---|---|
| Framework | React | 19.2 |
| Language | TypeScript | 5.8 |
| Build Tool | Vite | 6.4 |
| CSS | Tailwind CSS | 4.2 |
| UI Library | shadcn/ui (Radix) | - |
| State | TanStack Query | 5.83 |
| Router | React Router | 7.6 |
| Forms | React Hook Form + Zod | - |
| Charts | Recharts | 2.15 |
| i18n | i18next | 25.2 |
Core Banking Stack
| Component | Technology | Version |
|---|---|---|
| Language | Java | 17 |
| Framework | Spring Boot | 3.2.5 |
| Security | Spring Security + JWT | - |
| ORM | Spring Data JPA/Hibernate | - |
| Database | PostgreSQL | 16 |
| Cache | Redis | - |
| Real-time | WebSocket (STOMP) | - |
Database Schema
PostgreSQL (RBAC)
-- Tenants
CREATE TABLE tenants (
id SERIAL PRIMARY KEY,
name VARCHAR(255),
slug VARCHAR(100) UNIQUE
);
-- Applications
CREATE TABLE applications (
id SERIAL PRIMARY KEY,
name VARCHAR(255),
slug VARCHAR(100) UNIQUE,
description TEXT,
status VARCHAR(50) DEFAULT 'active'
);
-- Users
CREATE TABLE users (
id SERIAL PRIMARY KEY,
kc_id VARCHAR(255),
username VARCHAR(100) UNIQUE,
email VARCHAR(255)
);
-- Roles & Permissions
CREATE TABLE roles (
id SERIAL PRIMARY KEY,
name VARCHAR(100),
description TEXT
);
CREATE TABLE permissions (
id SERIAL PRIMARY KEY,
resource VARCHAR(100),
action VARCHAR(100)
);
-- User-Tenant-Role mapping
CREATE TABLE user_tenant_roles (
user_id INT REFERENCES users(id),
tenant_id INT REFERENCES tenants(id),
role_id INT REFERENCES roles(id),
PRIMARY KEY (user_id, tenant_id, role_id)
);
-- Tenant Aliases (OpenSearch index patterns)
CREATE TABLE tenant_aliases (
id SERIAL PRIMARY KEY,
tenant_slug VARCHAR(100),
alias_name VARCHAR(255),
index_pattern VARCHAR(255),
filter_json TEXT
);
OpenSearch Index Templates
logs-* (Application Logs)
| Field | Type | Description |
|---|---|---|
@timestamp | date | Timestamp |
message | text | Log message |
level | keyword | Log level (info, warn, error) |
source_type | keyword | Source type |
app_slug | keyword | Application slug |
tenant_id | keyword | Tenant identifier |
wazuh-alerts-* (Security Alerts)
| Field | Type | Description |
|---|---|---|
@timestamp | date | Timestamp alert |
alert_id | keyword | ID unik alert |
rule_id | keyword | Rule ID dari Wazuh |
rule_description | text | Deskripsi rule |
rule_level | integer | Risk level (1-15) |
alert_status | keyword | active/resolved |
agent_id | keyword | Agent ID |
agent_name | keyword | Hostname agent |
full_log | text | Full log message |
audit-log-* (Audit Trail)
| Field | Type | Description |
|---|---|---|
@timestamp | date | Timestamp event |
actor | keyword | User yang melakukan aksi |
action | keyword | Jenis aksi |
target | keyword | Target aksi |
result | keyword | success/failed |
ip | keyword | IP address actor |
details | object | Detail tambahan |
dashboard-services
| Field | Type | Description |
|---|---|---|
source.system_name | keyword | Nama sistem |
source.service | keyword | Nama service |
source.status | keyword | Status (Operational/Down) |
source.uptime_percent | float | Uptime percentage |
source.request_count | long | Jumlah request |
source.avg_latency_ms | float | Average latency |
source.error_rate_percent | float | Error rate |
source.log_count | long | Jumlah log |
Resource Limits
| Service | Memory | CPU | Notes |
|---|---|---|---|
| Backend | 384m | 0.25 | Go API server |
| Frontend | 256m | 0.25 | Nginx serving static |
| OpenSearch | 2g | 1.00 | Main search engine |
| OpenSearch Dashboards | 512m | 0.50 | Visualization UI |
| Fluentd | 512m | 0.25 | Log forwarding |
| Fluent Bit | 128m | 0.25 | Log collector |
| Wazuh Manager | 256m | 0.25 | Security monitoring |
| Keycloak | 1g | 1.00 | Authentication |
| Logstash | 1g | 0.50 | DB sync |
| RabbitMQ | 256m | 0.25 | Message bus |
| MinIO | 256m | 0.25 | Object storage |
| Kestra | 512m | 0.25 | Workflow |
| Grafana | 256m | 0.25 | Metrics viz |
| Prometheus | 512m | 0.50 | Metrics store |
| Consumer | 128m | 0.25 | RabbitMQ consumer |
| PostgreSQL | 256m | 0.25 | RBAC database |
| Camel | 256m | 0.25 | Integration |
Health Checks
| Service | Health Check | Interval |
|---|---|---|
| OpenSearch | /_cluster/health | 30s |
| Wazuh Manager | pgrep wazuh-analysisd | 30s |
| RabbitMQ | rabbitmq-diagnostics check_port_connectivity | 30s |
| Logstash | curl http://localhost:9600/_node/stats | 30s |
| Prometheus | wget http://localhost:9090/-/healthy | 30s |
| Grafana | wget http://localhost:3000/api/health | 30s |
| MinIO | curl http://localhost:9000/minio/health/live | 30s |
| Kestra | curl http://localhost:8080/ | 30s |
| Backend | curl http://localhost:8081/healthz | - |
| Consumer | wget http://localhost:8082/healthz | 30s |
Next Steps
- Data Flow - Alur data secara detail
- Network Topology - Topologi jaringan
- Security - Implementasi keamanan