This page is a gap analysis: it maps the security controls that Kommander.ai actually implements and documents to the requirements of ISO/IEC 27001:2022 (Annex A), ISO/IEC 27017 (cloud security), and ISO/IEC 27018 (protection of PII in public clouds).
It is written so that Kommander.ai can serve as the worked example inside Gorilli’s broader Information Security Management System (ISMS). Gorilli’s ISMS — risk register, policies, management review, internal audit, and Statement of Applicability — is the system under certification; Kommander is the concrete service used to demonstrate how those controls are realised in a production cloud application.
This is a self-assessment for audit preparation, not a certification claim. Each control status reflects the state of the codebase at the time of review. Re-verify evidence before any external audit, and reconcile every “Gap” row against Gorilli’s central risk register and Statement of Applicability.
How to read this page
Each control row carries a status:
| Status | Meaning |
|---|---|
| Implemented | Enforced in code/configuration, with verifiable evidence in the repository. |
| Partial | Present but incomplete, dependent on framework defaults, or not enforced everywhere it should be. |
| Documented only | Described in product/security docs but relying on operational process or deployment configuration rather than application code. |
| Gap | Not present, or expected by the standard and currently missing. Drives the remediation backlog. |
| Org-level | Owned by Gorilli’s ISMS rather than the Kommander codebase (HR, physical, governance). Listed for completeness; evidence lives outside this repo. |
Methodology
This analysis combined:
- Documentation review of the existing Security section (RBAC, HMAC identity, data residency, prompt-injection, compliance & audit, security operations, known limitations).
- Source-code verification of the load-bearing claims — authentication, session, RBAC enforcement, credential encryption, audit-log redaction, HMAC verification, consent, and DSAR handling — against the actual implementation in
frontend/,backend/, andapp/api/. - Cloud/operations inventory across the three repositories (
kommander.ai2,kommander-rag-backend,kommander-landing) for subprocessors, secrets handling, logging, CI/CD, and backup posture.
Scope of the example system
| Attribute | Value |
|---|---|
| Service | Kommander.ai — multi-tenant AI customer-service platform |
| Application stack | Next.js 15, TypeScript, MongoDB, NextAuth (Auth.js v5) |
| RAG backend | FastAPI (Python), Qdrant vector store |
| Role under PII regimes | PII processor on behalf of customers (organizations), who are the controllers of their end-users’ data |
| Hosting | Vercel (app + landing), managed PaaS (RAG backend) |
| Primary data stores | MongoDB (incl. GridFS), Supabase storage, Qdrant |
| Sub-processors | OpenAI, Stripe, Resend, Inngest, Qdrant Cloud, Supabase, WhatsApp/Baileys, Bananaloop (error capture) |
ISO/IEC 27001:2022 — Annex A control mapping
Annex A (2022) groups 93 controls into four themes. The tables below cover the controls that Kommander, as an application, materially exercises. Purely governance/HR/physical controls are marked Org-level and are owned by Gorilli’s ISMS.
A.5 Organizational controls
| Control | Topic | Status | Evidence / Notes |
|---|---|---|---|
| A.5.1 | Policies for information security | Org-level | Gorilli ISMS policy set; Kommander contributes the Security operating model. |
| A.5.7 | Threat intelligence | Partial | Threat model documented in Security Operations; no automated threat-feed ingestion. |
| A.5.15 | Access control | Implemented | RBAC enforced server-side; see RBAC and A.8.3 below. |
| A.5.16 | Identity management | Implemented | NextAuth identities; users + organization_members collections; platform isAdmin separated from org roles (frontend/auth.config.ts). |
| A.5.17 | Authentication information | Implemented | bcrypt password hashing (cost 10), complexity policy on registration (frontend/lib/schemas/auth.schemas.ts). |
| A.5.18 | Access rights (provisioning/review) | Partial | Membership add/remove/role-change implemented; no scheduled access-review/recertification workflow — track at ISMS level. |
| A.5.19–A.5.22 | Supplier / cloud service relationships | Documented only | Sub-processor list maintained (see 27018 below); DPAs / supplier security clauses are not held in-repo — Gorilli to maintain the supplier register. |
| A.5.23 | Information security for cloud services | Documented only | Cloud responsibility split described in Security Operations; formalised under ISO 27017 below. |
| A.5.24–A.5.28 | Incident management | Documented only | Public IR procedure in Security Operations; internal runbook, on-call, and breach-notification timelines are Org-level gaps. |
| A.5.30 | ICT readiness for continuity | Gap | No documented RTO/RPO, DR plan, or restore-test evidence (backups rely on Atlas/Supabase managed defaults). |
| A.5.31 | Legal, statutory, regulatory requirements | Documented only | GDPR posture in code (consent, DSAR service); regulatory register is Org-level. |
| A.5.34 | Privacy and protection of PII | Partial | Consent capture + GDPR service implemented; DSAR not self-service (see A.8 / 27018). |
A.6 People controls
| Control | Topic | Status | Evidence / Notes |
|---|---|---|---|
| A.6.1–A.6.6 | Screening, terms, awareness, disciplinary, NDAs | Org-level | Owned by Gorilli HR/ISMS; not represented in the Kommander codebase. |
| A.6.7 | Remote working | Org-level | Gorilli policy. |
| A.6.8 | Information security event reporting | Documented only | Responsible disclosure covers external reporters; internal reporting is Org-level. |
A.7 Physical controls
| Control | Topic | Status | Evidence / Notes |
|---|---|---|---|
| A.7.1–A.7.14 | Physical & environmental security | Org-level | Inherited from cloud providers (Vercel, MongoDB Atlas, Supabase, Qdrant Cloud). Collect provider attestations (SOC 2 / ISO 27001 certificates) for the supplier register. |
A.8 Technological controls
This is where Kommander provides the strongest, code-verifiable evidence.
| Control | Topic | Status | Evidence / Notes |
|---|---|---|---|
| A.8.1 | User endpoint devices | Org-level | Gorilli device policy. |
| A.8.2 | Privileged access rights | Implemented | Platform admin (isAdmin) is a distinct JWT/credential path from org roles; /api/admin/* requires isAdmin (app/api/admin/*). |
| A.8.3 | Information access restriction | Implemented | Routes fail closed — 401 without session, 403 without authorization. Verified across organizations, billing, conversations routes. See RBAC. |
| A.8.4 | Access to source code | Partial | Repos are git-managed; branch protection / code-owner enforcement is Org-level and not verified here. |
| A.8.5 | Secure authentication | Partial | bcrypt + complexity + login rate-limit (10/15 min) implemented. MFA is email-OTP at signup only — not enforced per login; no TOTP. Cookie flags rely on NextAuth v5 defaults (not explicitly pinned). |
| A.8.6 | Capacity management | Documented only | Managed by Vercel/Atlas autoscaling; no documented capacity thresholds. |
| A.8.8 | Management of technical vulnerabilities | Partial | Vulnerability-management procedure + register now in place (Gestione Vulnerabilità); 2 criticals (jspdf) remediated and verified. Still missing: Dependabot / npm audit / SCA in CI and SBOM (tracked). Lockfiles present; patch-package used. |
| A.8.9 | Configuration management | Partial | .env.example documents required config; vercel.json/next.config.ts hold app config. No central config baseline doc. |
| A.8.10 | Information deletion | Partial | backend/lib/gdpr.ts implements cascading delete + anonymisation across users, conversations, files, analytics, consent, billing — but it is not exposed via an API endpoint (admin-invoked only). |
| A.8.11 | Data masking | Implemented | Audit-log redaction strips credentials, tokens, emails, fiscal codes, phone numbers, tax IDs, userHash, etc., before persistence (backend/lib/audit/toolAudit.ts). Connector credentials never returned in plaintext. |
| A.8.12 | Data leakage prevention | Partial | Tool ownership filtering + identity-bound tool exposure; no DLP on bulk read/export paths, no egress monitoring. |
| A.8.13 | Information backup | Documented only | Relies on MongoDB Atlas / Supabase managed backups; no in-repo backup policy or restore-test evidence (links to A.5.30). |
| A.8.15 | Logging | Partial | Tool audit logs (tool_audit_logs) with correlation IDs + redaction; error capture via Bananaloop (instrumentation.ts). No centralized SIEM, no defined log retention window. |
| A.8.16 | Monitoring activities | Gap | OpenTelemetry API is imported but no tracing/metrics pipeline wired; status page (Instatus) only. No security alerting. |
| A.8.18 | Use of privileged utility programs | Implemented | Internal endpoints gated by INTERNAL_API_SECRET; RAG backend signs requests to the app. |
| A.8.20 | Network security | Partial | TLS in transit (Vercel/HTTPS); inter-service auth via shared secrets. No private networking/VPC; all endpoints public. |
| A.8.21 | Security of network services | Partial | Vercel-provided DDoS mitigation; per-route + per-auth rate limiting (MongoDB-backed) — fails open if MongoDB is unavailable. |
| A.8.22 | Segregation of networks | Gap | App and RAG backend communicate over public endpoints with shared-secret auth; no network segmentation. |
| A.8.23 | Web filtering | N/A | Not applicable to this service profile. |
| A.8.24 | Use of cryptography | Implemented | AES-256-GCM for connector/identity secrets at rest with key-rotation support (backend/lib/credentials.ts, backend/lib/identitySecret.ts); HMAC-SHA-256 with constant-time compare for widget identity (backend/lib/security/hmac.ts). No formal key-management/cryptography policy document. |
| A.8.25 | Secure development life cycle | Partial | Security-relevant changes trigger doc review + security tests (HMAC, SSRF, prompt-injection); no formal SDLC policy. |
| A.8.26 | Application security requirements | Implemented | Fail-closed authz, signed identity, tool allow-lists, ownership checks (see Security overview). |
| A.8.27 | Secure system architecture | Implemented | Documented trust boundaries and architecture diagrams in Security and Compliance & Audit. |
| A.8.28 | Secure coding | Partial | Input validation (zod schemas), parameterised Mongo queries, prompt-injection tests; no documented secure-coding standard. |
| A.8.29 | Security testing in development | Partial | test:hmac, test:security, test:prompt-injection exist; Playwright visual regression disabled in CI; no DAST/penetration-test cadence. |
| A.8.31 | Separation of dev/test/prod | Partial | Separate env config; shared dev secrets used locally — ensure prod uses distinct, rotated secrets per environment. |
| A.8.32 | Change management | Partial | Git + PR workflow + release checklist in Security Operations; no formal change-approval record. |
| A.8.34 | Protection during audit testing | Documented only | Audit procedure in Compliance & Audit. |
ISO/IEC 27017 — cloud-specific controls
27017 extends 27001 with cloud-service guidance and adds cloud-specific controls. As a cloud service customer (of Vercel, Atlas, Qdrant, Supabase, OpenAI, Stripe) and a cloud service provider (to its own customers), Kommander has responsibilities on both sides.
| 27017 control | Topic | Status | Evidence / Notes |
|---|---|---|---|
| CLD.6.3.1 | Shared roles & responsibilities in cloud | Documented only | Provider/customer split described in Security Operations; needs a formal responsibility matrix per sub-processor. |
| CLD.8.1.5 | Removal of cloud assets on contract exit | Partial | Account/org deletion + cascade exists (backend/lib/gdpr.ts); provider-side data return/erasure on exit not contractually documented. |
| CLD.9.5.1 | Segregation in virtual/multi-tenant environments | Implemented | Tenant isolation via organizationId scoping + ownership checks on every data path; widget traffic scoped to widget client. |
| CLD.9.5.2 | Virtual machine hardening | Org-level | Inherited from Vercel/managed PaaS; collect provider hardening attestations. |
| CLD.12.1.5 | Administrator operational security | Partial | Platform-admin separation + audit logging; no documented admin operational procedures / break-glass process. |
| CLD.12.4.5 | Logging of cloud customer activities | Partial | Tool/admin audit logs exist; no per-customer exportable activity log feature, no retention SLA. |
| CLD.13.1.4 | Alignment of network management & cloud security | Gap | Public inter-service communication; see A.8.22 segregation gap. |
| — | Data residency / region pinning | Gap | No per-organization residency selection; documented as a known limitation in Data Residency. Capture deployment regions per residency checklist. |
| — | Provider certifications evidence | Gap | Collect SOC 2 / ISO 27001 certificates from Vercel, Atlas, Supabase, Qdrant, OpenAI, Stripe for the supplier register. |
ISO/IEC 27018 — protection of PII in public clouds
27018 applies to Kommander as a PII processor. Customers (organizations) are controllers; their end-users’ conversations, uploaded documents, and identity data are the PII.
| 27018 area | Topic | Status | Evidence / Notes |
|---|---|---|---|
| Consent & choice | Lawful basis / consent capture | Implemented | app/api/privacy/consent stores necessary/analytics/marketing/functional consent with timestamp, version, IP, user-agent in user_consents. |
| Purpose limitation | Process PII only on controller instruction | Documented only | Data-minimisation guidance for connectors/prompts in Data Residency; enforced by guidance, not technical control. |
| Data minimisation | Minimise PII in prompts/logs/tools | Partial | Audit redaction (A.8.11) strong; prompt/LLM payloads to OpenAI may contain PII without redaction. |
| Transparency | Disclose sub-processors & locations | Partial | Sub-processor list known internally; no published, versioned sub-processor list for customers. |
| Individual rights | Access, rectification, erasure, portability | Partial | Full DSAR service (processDataAccessRequest, deleteUserData, exportUserDataPortable, anonymizeUserData) exists but is not exposed via a self-service or admin API endpoint — currently code-invoked only. |
| Retention & disposal | Defined retention + secure deletion | Partial | Retention behaviour documented in Data Residency; retention windows not configurable per org; some deletion is manual. |
| Accountability | Records of PII processing & breach notice | Gap | No formal Record of Processing Activities (ROPA); breach-notification timeline (e.g. 72h) not documented. |
| Encryption of PII | Protect PII in transit and at rest | Partial | Secrets/credentials AES-256-GCM at rest; TLS in transit. Conversation/file PII at rest relies on provider-managed encryption (Atlas/Supabase defaults) — confirm and document. |
| Sub-processor obligations | Flow-down of PII terms to sub-processors | Documented only | Requires DPAs with OpenAI, Stripe, Resend, Qdrant, Supabase, Inngest — Org-level supplier register. |
| Return/transfer/disposal | Return or delete PII at end of service | Partial | Account deletion cascade exists; provider-side erasure on exit not documented (links to CLD.8.1.5). |
Prioritized remediation backlog
Ordered by risk-to-effort for moving Kommander toward audit-ready. P1 items are the most defensible to close before an audit walkthrough.
P1 — close before audit
- Expose DSAR endpoints. The GDPR service (
backend/lib/gdpr.ts) already implements access/export/erasure/anonymisation with cascade — wire authenticated API routes (and ideally a self-service UI) so data-subject rights are demonstrable, not just code-present. (A.8.10, 27018 individual rights) - Add dependency/vulnerability scanning to CI. Enable Dependabot +
npm audit/pip-audit(or Snyk) and generate an SBOM. Currently no SCA exists. (A.8.8) - Document key management & cryptography policy. Algorithms, key sources, rotation cadence, and grace periods are implemented in code but not captured in a policy artifact. (A.8.24)
- Publish a versioned sub-processor list and assemble the supplier register (DPAs + provider SOC 2/ISO certificates). (A.5.19–A.5.23, 27017 provider certs, 27018 sub-processor obligations)
- Confirm and document encryption-at-rest for conversation/file PII in MongoDB Atlas and Supabase (provider settings), not just for secrets. (A.8.24, 27018 encryption)
P2 — strengthen for maturity
- Add security headers to the main app (CSP, HSTS, X-Frame-Options) — currently only on
kommander-landing. Enforce CSP (removeunsafe-inline). (A.8.20, A.8.26) - Harden rate limiting so it fails closed (or degrades safely) when MongoDB is unavailable. (A.8.21)
- Strengthen authentication: enforce MFA at login (TOTP), and explicitly pin session-cookie flags (
httpOnly,secure,sameSite) rather than relying on framework defaults. (A.8.5) - Define logging retention + centralized monitoring/alerting. Wire the OpenTelemetry API to an actual pipeline; set audit-log retention. (A.8.15, A.8.16)
- Document continuity: RTO/RPO, DR plan, and a periodic backup-restore test. (A.5.30, A.8.13)
P3 — defense in depth
- Network segregation between the app and RAG backend (private networking instead of public endpoints + shared secret). (A.8.22, CLD.13.1.4)
- Per-organization data residency / retention configuration. (27017 residency, 27018 retention)
- Access-review/recertification workflow for org members and platform admins. (A.5.18)
- Formal ROPA and breach-notification procedure with regulatory timelines. (27018 accountability)
Note on a corrected finding
During verification, an initial automated pass flagged “live secrets committed to the repository.” This was checked directly and is not accurate: the .env files in kommander.ai2 and kommander-rag-backend are correctly covered by .gitignore (.env* with a !.env.example exception) and have never been committed to git history. The keys exist only as local developer working-tree files, which is expected. No secret-exposure remediation is required on that basis — though P1 item on environment separation (A.8.31) still applies to ensure production uses distinct, rotated secrets.
Evidence index
| Control area | Primary evidence locations |
|---|---|
| Authentication | frontend/auth.config.ts, frontend/lib/schemas/auth.schemas.ts, frontend/auth.actions.ts |
| Session | backend/lib/sessionService.ts, middleware.ts |
| RBAC / authz | app/api/**/route.ts, RBAC matrix |
| Cryptography | backend/lib/credentials.ts, backend/lib/identitySecret.ts, backend/lib/security/hmac.ts |
| Audit & redaction | backend/lib/audit/toolAudit.ts |
| Consent & DSAR | app/api/privacy/consent/route.ts, backend/lib/gdpr.ts |
| Rate limiting | backend/lib/security/index.ts |
| Security tests | backend/lib/security/*.test.ts |
| Cloud / ops | vercel.json, next.config.ts, instrumentation.ts, .github/workflows/*, kommander-rag-backend/ |