Konsol — Security Architecture & Excel Online Integration
Last updated: 2026-06-06
Overview
This document describes the security architecture for exposing Konsol to Excel Online and web users, using Frappe as the application layer and ClickHouse (cloud-hosted) as the analytical backend.
Design principles:
- Frappe owns application concerns (users, config, workflows, write-back, audit)
- ClickHouse owns analytical concerns (GL data, consolidation, reporting)
- ClickHouse is never exposed to the internet — all access goes through Frappe or Cube
- Excel users get
=EPM(...)custom functions that work in Online, Desktop, and iPad
Architecture
┌──────────────────────────────────────────────────────┐
│ Users │
│ ┌──────────┐ ┌──────────────┐ ┌────────────────┐ │
│ │ Excel │ │ Excel Online │ │ Frappe Desk │ │
│ │ Desktop │ │ / iPad │ │ (Web UI) │ │
│ │ (ODBC) │ │ (Add-in) │ │ │ │
│ └────┬─────┘ └──────┬───────┘ └───────┬────────┘ │
└───────┼───────────────┼──────────────────┼────────────┘
│ │ │
│ HTTPS + Frappe session │
▼ ▼ ▼
┌──────────────────────────────────────────────────────┐
│ Frappe (Application Layer) │
│ │
│ DocTypes: │
│ ├─ Budget Entry (write-back, workflow) │
│ ├─ Scenario (budget/forecast/whatif) │
│ ├─ Consolidation Group (entities, ownership %) │
│ ├─ IC Elimination Rule (debit/credit pairs) │
│ ├─ Allocation Rule (step, driver, accounts) │
│ └─ EPM Report (saved report definitions) │
│ │
│ Built-in: Auth, RBAC, Workflows, Audit, REST API │
│ DB: MariaDB/PostgreSQL (metadata + config only) │
└──────────────────┬───────────────────────────────────┘
│ clickhouse-connect (Python)
▼
┌──────────────────────────────────────────────────────┐
│ ClickHouse (Azure / AWS — managed or self-hosted) │
│ │
│ epm_bronze ← Airbyte (D365 OData extraction) │
│ epm_silver ← dbt (standardized) │
│ epm_gold ← dbt (consolidated TB, IC elim, CTA) │
│ epm_staging ← Frappe writes budget data here │
│ │
│ Cube SQL API (port 15432) → Excel ODBC / Add-in │
└──────────────────────────────────────────────────────┘
Security Layers
1. Identity & Authentication
The shipped implementation uses Frappe's native session authentication. Entra ID SSO is a roadmap target, not yet implemented.
| Mechanism | Details | Status |
|---|---|---|
| Frappe session login | Users sign in with username/password via POST /api/method/login; Frappe issues a session cookie | Shipped |
| Excel Add-in auth | The add-in calls /api/method/login and reuses the session cookie on every request (fetch(..., credentials: "include")) — no tokens or Bearer headers | Shipped |
| API access | Whitelisted (@frappe.whitelist) methods read the caller from frappe.session.user; RBAC enforced from the session | Shipped |
| 2FA | Frappe built-in — configurable per role | Available |
| Entra ID SSO | Microsoft Entra ID (Azure AD), same tenant as D365 F&O, via Frappe Social Login | Roadmap |
2. Authorization (Role-Based Access)
| Role | Desk UI | Excel Read | Excel Write | Config Edit |
|---|---|---|---|---|
| Reader | View reports, dashboards | =EPM(...) queries | No | No |
| Planner | View + submit budgets | Full read | =EPMSAVE(...) budget write-back | No |
| Controller | Full access | Full read | Full write | Edit consolidation groups, IC rules, allocations |
| Admin | Full access | Full read | Full write | All config + user management |
Frappe RBAC enforces this on every DocType and API endpoint automatically.
3. Transport & Network
| Layer | Implementation |
|---|---|
| TLS | Caddy reverse proxy with automatic Let's Encrypt certificates |
| CORS | Whitelist *.officeapps.live.com + company tenant domain |
| Rate limiting | 100 requests/min per user (prevents runaway Excel refresh loops) |
| ClickHouse isolation | Private network only — no public endpoint. All access via Frappe or Cube. |
| Cube SQL API | Internal network only, or VPN for desktop Excel ODBC users |
4. Audit Trail
Frappe provides automatic audit logging on every DocType:
- Every create, update, delete is logged with user, timestamp, and field-level diff
- Budget submissions tracked: who submitted, when, what values, approval chain
- API access logged: which user queried which dimensions
- Configuration changes tracked: who changed consolidation groups, IC rules, ownership %
No custom code needed — this is Frappe's built-in behavior.
5. Data Protection
| Concern | Approach |
|---|---|
| PII in GL data | ClickHouse stores account-level aggregates, not transactional PII. Personal data stays in D365. |
| Budget confidentiality | Role-based: planners see only their entity/cost center (Frappe user permissions) |
| Encryption at rest | ClickHouse Cloud and Azure/AWS managed disks provide this by default |
| Encryption in transit | TLS everywhere (Frappe ↔ browser, Frappe ↔ ClickHouse, Airbyte ↔ D365) |
| Backup | ClickHouse Cloud: automatic. Self-hosted: scheduled snapshots to blob storage. |
Excel Online Integration: Custom Functions
The HSGETVALUE Equivalent
Konsol provides an Excel Custom Functions Add-in that registers cell formulas working in Excel Online, Desktop, and iPad. Read functions are debounced and batched into a single epm_batch POST on recalc:
| Formula | Purpose | API Endpoint |
|---|---|---|
=EPM(entity, year, period, account, [measure], [scenario], [cost_center], [dept]) | Single cell value (HSGETVALUE equivalent, actuals by default) | POST /api/method/konsol.api.epm_batch (batched) |
=EPM_BUDGET(entity, year, period, account, [cost_center], [dept]) | Budget amount | POST /api/method/konsol.api.epm_batch (batched) |
=EPM_VARIANCE(entity, year, period, account) | Actual vs budget variance | POST /api/method/konsol.api.epm_batch (batched) |
=EPM_DEBIT(entity, year, period, account) | Period debit | POST /api/method/konsol.api.epm_batch (batched) |
=EPM_CREDIT(entity, year, period, account) | Period credit | POST /api/method/konsol.api.epm_batch (batched) |
=EPMSAVE(amount, entity, year, period, account, scenario_id, layer) | Write budget data back (planner role only) | POST /api/method/konsol.api.budget_cell_save |
A single-value GET /api/method/konsol.api.epm_value endpoint is also exposed for direct queries.