Security Architecture

How Pain Points is Built

A transparent look at the authentication, authorisation, data isolation and security model behind the Pain Points platform.

Back to Pain Points

Platform Architecture

Every organisation is isolated at the data layer. Authentication is delegated entirely to Microsoft Entra ID — we never see or store passwords.

Employee
Opens Pain Points in browser
Microsoft Entra ID
OAuth 2.0 / MSAL
SSO via your company's M365 tenant
HTTPS + Entra ID Token
Pain Points Server
Node.js / Express / TypeScript
JWT Validation Rate Limiting RBAC
Managed Identity
Azure Key Vault
Secrets management
ORM • Encrypted TLS
ISOLATED
Organisation A
Users, pain points, proposals
Tenant-scoped data
ISOLATED
Organisation B
Users, pain points, proposals
Tenant-scoped data
ISOLATED
Organisation C
Users, pain points, proposals
Tenant-scoped data
Azure SQL Server • TLS Encrypted • Organisation-scoped queries via ORM
Employee
Browser login
Entra ID
OAuth 2.0 SSO
Pain Points Server
Node.js / Express
Org A
ISOLATED
Org B
ISOLATED

Authentication

Pain Points delegates all authentication to Microsoft Entra ID. We never store, transmit or handle passwords.

How sign-in works

1
Employee opens Pain Points

The React SPA detects no active session and redirects to Microsoft Entra ID via the MSAL library.

2
Microsoft handles login + MFA

The employee authenticates with their company's M365 credentials, including any MFA policies their IT admin enforces.

3
ID token issued

Entra ID returns a signed JWT (ID token) to the browser. The token is cached in sessionStorage — it's gone when the tab closes.

4
Server validates every request

Each API call includes the token as a Bearer header. The server verifies the RS256 signature against Microsoft's published JWKS keys, checks the audience and issuer, then resolves the user.

5
Auto-provisioning

First-time users are automatically created from the Entra ID claims (name, email, tenant ID). No manual setup required.

What this means for you

No passwords to manage

Pain Points has zero knowledge of any passwords. Your existing M365 password and MFA policies apply automatically.

Your MFA, your rules

Whatever MFA and conditional access policies your IT team has configured in Entra ID are enforced by Microsoft before Pain Points ever sees the token.

Instant offboarding

Disable a user in Entra ID and they immediately lose access to Pain Points. No separate account to deactivate.

Session-scoped tokens

Tokens live in sessionStorage only. Close the browser tab and the session ends. No persistent cookies.

Authorisation & Access Control

Every request passes through organisation-scoping and role-based access control before any data is returned.

Platform Admin

Full access across all organisations. Reserved for Grenadier Computing staff. Can view and manage all data for support and onboarding.

Customer Admin

Manage users and pain points within their own organisation. Can see all submissions (including anonymous submitter identity), configure categories, and manage the Kanban workflow.

User

Submit pain points, comment, upvote, and propose solutions within their organisation. Anonymous submissions hide the submitter's identity from other users (but not admins).

Organisation Scoping

Every user is bound to an organisation determined by their Azure tenant ID. All database queries are automatically scoped: users in Organisation A can never see data from Organisation B, regardless of role.

Data Security

How your data is stored, protected and kept separate from every other organisation.

TLS-Encrypted Database

All connections to Azure SQL Server use TLS encryption. Data is encrypted in transit between the application and the database at all times.

Organisation Isolation

Every query is scoped to the user's Azure tenant ID at the ORM level. There is no way for a user's request to return data belonging to another organisation.

Azure Key Vault

Production secrets (database credentials, client secrets, tenant IDs) are stored in Azure Key Vault and retrieved via Managed Identity — no secrets in code or environment files.

Anonymous Submissions

Employees can submit pain points anonymously. The submitter's identity is masked as “Anonymous” for all users except organisation admins, who need visibility for follow-up.

Audit Trail

Every authentication event, authorisation decision, and data change is logged with structured audit entries including user ID, IP address, request ID and timestamp.

No Sensitive Data Caching

All API responses include Cache-Control: no-store headers. Authenticated responses are never cached by browsers or intermediary proxies.

API Security

Every request to the Pain Points API passes through multiple layers of protection before reaching your data.

Security Middleware Stack

Every request passes through multiple layers of security middleware before reaching your data:

  • Security Headers — CSP, HSTS, X-Frame-Options and other protections via Helmet
  • CORS — Only configured origins can make requests
  • Request Size Limits — Payload size restrictions on all request bodies
  • Rate Limiting — Per-IP rate limiting on all endpoints, with stricter limits on write operations
  • JWT Validation — Token signature verified against Microsoft's published JWKS keys
  • User & Organisation Resolution — Maps token claims to the correct user and organisation
  • Input Validation — Schema-based validation on all route inputs

Input Validation

Every API endpoint validates its inputs with schema-based validation before processing. This includes string length limits, enum validation, format checks, and pagination bounds. Invalid requests are rejected before they reach any business logic.

Rate Limiting

Tiered rate limiting protects the platform: a global limit per IP address on all requests, with stricter limits on write operations per authenticated user.

Content Security Policy

The server enforces a strict CSP via Helmet:

  • default-src 'self' — only load resources from the same origin
  • script-src 'self' — no inline or third-party scripts
  • connect-src limited to self + Microsoft login endpoints

Infrastructure & Deployment

Production runs on Azure Container Apps with automated CI/CD, no stored credentials, and non-root containers.

Containerised

Multi-stage Docker build. Production image runs as a non-root user with minimal attack surface.

CI/CD Pipeline

GitHub Actions builds, tests, and deploys on every merge to main. Azure OIDC federation — no stored deployment credentials.

Health Checks

Container health probes run every 30 seconds. Unhealthy instances are automatically replaced by Azure Container Apps.

Graceful Shutdown

SIGTERM triggers a 10-second graceful drain, ensuring in-flight requests complete before the container stops.

Questions about our security model?

We're happy to walk you through the architecture in detail. Book a call or drop us a line.