RetailOSBy Grovix Ventures
Get Started
person
Security Architecture & Controls

Security & Enterprise Architecture

How Retail OS isolates and defends commercial transactions, WhatsApp OCR conversations, and live ERP database states. Built for high-volume B2B trading floors.

Tenant Isolation by Design: Top-level tenant-scoped records use indexed tenantId fields, with tenant context enforced at the application layer through Prisma query extensions and tenant-aware repository queries. PostgreSQL RLS provides an additional defense-in-depth layer where configured.

Top-level models such as Customer, Inventory and Enquiry have tenantId String and @@index([tenantId]) in prisma/schema.prisma. Child tables including ProductEmbedding, RateHistory, InventoryUnitRate and GalleryImage do not contain their own tenantId and are isolated through relationships with Inventory. RLS is not FORCE and can fail open if the tenant GUC is unset; superusers can bypass RLS.

Strict
Tenant-Scoped Data Access

Application-level tenant scoping using indexed tenantId fields, Prisma query-time isolation, and tenant-aware repository filters.

* App-level primary isolation; RLS provides defense-in-depth and is not FORCE-enabled.

TLS 1.2+
Encrypted Transit

Provider-negotiated TLS for external services, with short-lived Wasabi presigned URLs and tenant-prefixed object storage.

* Bucket-default AES-256; application code does not explicitly configure S3 SSE/KMS.

Ephemeral Processing
AI / OCR Processing

External AI services process extraction requests, while embeddings and learned mappings are persisted for application functionality.

AI processing is designed around request-based inference, but application-level persistence exists for embeddings, mappings, and caching.

99.9%
Uptime Target

Target availability objective; automated backups and PITR are roadmap items rather than currently implemented infrastructure.

* Roadmap: managed backups, nightly snapshots, PITR, and disaster-recovery automation.

Architecture & Defense Depth

Updated Q1 2026

Tenant Isolation & RBAC

Application-level tenant scoping, relational tenant boundaries, and role-based access controls.

  • ✓Tenant-Aware Query Scoping: Tenant context is established through authenticated requests and applied to supported Prisma-scoped models and tenant-aware repository queries. Top-level tenant-scoped entities use indexed tenantId fields, while several child entities inherit isolation through Inventory relationships.
  • ✓Granular Role Boundaries: Access gates distinguish SUPER_ADMIN and tenant-level operational roles through requireSuperAdmin and requireRole authorization middleware.
  • ✓Token Versioning: JWTs include a token-version mechanism that supports session invalidation and credential revocation; logout/session behavior should not be described as instantaneous universal revocation.

Multimodal AI & OCR Privacy

AI-assisted extraction for product data, OCR workflows, and multimodal business inputs with application-level persistence controls.

  • ✓Request-Based AI Processing: Gemini-based vision and extraction services are used for OCR/product extraction. The application does not enforce a universal zero-retention or zero-training guarantee at the code level.
  • ✓Tenant-Aware Embedding Retrieval: Product embeddings are stored for application functionality and can be filtered by tenant through repository queries. Legacy/null tenant paths exist and should not be represented as absolute isolation guarantees.
  • ✓Presigned Wasabi Storage: Object storage uses tenant-prefixed paths and short-lived presigned URLs. Public quotation access additionally uses tenant-aware verification, although a legacy verification path remains.

Perimeter Defense & Queues

HTTP security headers, authentication throttling, and asynchronous job processing.

  • ✓HTTP Security Hardening: Helmet is enabled with HSTS defaults, and CORS is restricted to the configured frontend origin. Content Security Policy is currently disabled and should not be represented as an active control.
  • ✓BullMQ on Redis: Background processing uses BullMQ with Redis for asynchronous jobs such as quote generation and automation workflows.
  • ✓Authentication Rate Limiting: Authentication endpoints have rate limiting, including a 10 requests/minute protection on relevant authentication routes. CSRF middleware is installed but currently unused, and global request throttling is not implemented.

Known limitation: json 50mb request parsing and the absence of global proxy/rate-limit controls remain hardening opportunities.

Operational Rigor & Compliance

Payment tokenization, operational controls, and security-hardening roadmap.

  • ✓Zero Card Retention: Razorpay hosted checkout is used for payment processing. Retail OS does not store raw card PAN or CVV data in the application database.
  • ◐Backup Strategy — Roadmap: Automated nightly PostgreSQL backups, S3 versioning, and point-in-time recovery are planned operational capabilities and are not currently implemented in the application deployment.
  • ◐Incident Response — Documented Commitment Required: Security findings can be reported through [email protected], with an initial acknowledgement target of 24 hours. A formal 72-hour incident SLA is not currently documented and must not be claimed.

Roadmap / Known Limitations

Security controls currently identified for hardening, standardization, and operational maturity.

Authentication & Session Security

  • OTP generation currently uses Math.random in google-smtp.service.ts:171; migrate to crypto.randomInt.
  • Access tokens are currently stored in browser localStorage (auth.tsx:99), increasing XSS exposure.
  • Password hashing currently uses bcrypt cost 10; target cost should be reviewed.
  • A default SUPER_ADMIN_PASSWORD value exists in configuration and must be replaced with a securely managed secret.
  • Refresh-token/session architecture currently uses a single refresh:${id} Redis key with an approximately 8-hour window.
  • Email verification behavior can expose account existence through a 404 response.
  • OTP values may be logged in development environments.

API / Transport Hardening

  • Socket authentication is weaker than the HTTP authentication path.
  • CAPTCHA is not currently implemented.
  • CSP is disabled in Helmet configuration.
  • csurf is installed but not currently used.
  • trust proxy is not configured.
  • Global rate limiting is not implemented.
  • Large JSON request limits (50mb) should be reviewed for denial-of-service resilience.

Storage & Third-Party Resources

  • S3 uploads do not explicitly configure SSE/KMS encryption in application code.
  • Storage currently relies on provider/bucket-level encryption defaults.
  • Third-party fonts/PostHog resources do not use Subresource Integrity.
  • Development S3 mock storage is world-readable and must never be used for production data.

Privacy & Data Lifecycle

  • No complete application-level GDPR retention, deletion, or export workflow is currently implemented.
  • Product embeddings and learned mappings are persisted.
  • AI cache data can persist for up to 7 days.
  • AI provider data-handling guarantees should be documented separately from what is technically enforced by application code.

Infrastructure & Recovery

  • Automated database snapshots are not currently implemented.
  • PITR is not currently implemented.
  • Disaster-recovery automation is a roadmap item.
  • S3 versioning is not currently verified as enabled.
  • RLS should be strengthened to avoid fail-open behavior when tenant context is missing and evaluated for FORCE ROW LEVEL SECURITY where appropriate.

Footnotes

  • * App-level primary isolation; RLS is defense-in-depth and is not FORCE-enabled.
  • * Bucket-default AES-256; application code does not explicitly configure S3 SSE/KMS.
  • * Roadmap: CSP, HSTS hardening, trusted proxy configuration, CSRF enforcement, S3-KMS, automated backups, and data erase/export workflows.
Vulnerability Disclosure

Report a Security Finding

We maintain an open channel for responsible security researchers and enterprise security compliance audits.

Direct Compliance Desk:
[email protected]
Guaranteed initial acknowledgement within 24 hours

Note: Marketing frontends are physically hosted separately from backend processing clusters to enforce perimeter isolation.

Talk to Our Security EngineersDownload Architecture Spec (PDF)
All Retail OS Systems Operational