Skip to content
CloudDIFFICULTY: AdvancedSTATUS: Prototype

Multi-Tenant GraphQL Support System

Server-Side Tenant Isolation with AppSync

GitHub Repository
Client / ScopePersonal Lab Build
My RoleSole Developer
Duration—
Completion Date—

1. SYSTEM OVERVIEW

Executive Summary

A multi-tenant GraphQL support ticket system on AppSync and DynamoDB with server-side tenant membership resolution from Cognito, fine-grained authorization on every operation, optimistic concurrency, tenant-scoped real-time subscriptions, and a documented least-privilege authorization model.

Business Problem

SaaS support data leaks across tenants when authorization lives in client code or is checked inconsistently.

Business Impact Value

Demonstrates tenant isolation done correctly: membership resolved server-side from identity, enforced on every operation, with the model documented and tested.

Key Engineering Goals
  • Resolve tenant membership server-side from Cognito identity
  • Enforce fine-grained authorization on all operations
  • Keep real-time subscriptions strictly tenant-scoped
My System Responsibilities
  • Designed the authorization model and tenant isolation scheme
  • Implemented resolvers, concurrency control, and scoped subscriptions
  • Ran security testing and documented the complete model

2. SYSTEM FEATURES

Server-Side Tenant ResolutionComplexity: High

Tenant membership comes from verified Cognito identity, never client claims.

Impl:Resolvers derive tenant context from the authentication token.
Per-Operation AuthorizationComplexity: High

Every query, mutation, and subscription checks tenant scope.

Impl:Authorization rules applied uniformly across all resolvers.
Tenant-Scoped SubscriptionsComplexity: Medium

Real-time ticket updates stay within the tenant boundary.

Impl:Subscription filters bound to resolved tenant context.

3. SYSTEM ARCHITECTURE

Identity-first API: authentication establishes who you are, resolvers establish which tenant you belong to, and every data path re-checks both.

Topology Vector Diagram
Client ──> Cognito Auth ──> AppSync ──┬──> Tenant Resolver ──> DynamoDB (tenant-partitioned)
                                       └──> Subscriptions (tenant-scoped)
Pipeline flow sequences
User authenticates via Cognito
Resolvers extract tenant membership server-side from the token
Queries and mutations filter by tenant partition
Optimistic concurrency guards conflicting ticket updates
Subscriptions deliver only same-tenant events
Repo directory structure
graphql-multitenant/
├── schema.graphql             # Types + directives
├── resolvers/                 # Tenant-aware resolvers
├── auth/
│   └── model.md               # Documented authorization model
└── tests/
    └── cross-tenant.spec      # Negative security tests

4. INTERACTIVE SIMULATOR WIDGET

Run active operations audits utilizing the custom sandbox telemetry receiver widget below.

No interactive widget available for this system configuration.

5. ENGINEERING ARCHITECTURE DECISIONS (ADRs)

Decision ProfileChoose where tenant isolation is enforced
Context

Client-side checks are bypassable; missing a single resolver creates a leak.

Alternatives Checked
  • Client-side tenant headers
  • Per-resolver server checks
  • Separate stack per tenant
Selected Decision

Per-resolver server checks from Cognito identity

Advantages
  • No trust in client-supplied tenant identifiers
  • Uniform enforcement across queries, mutations, subscriptions
  • Single deployment to operate
Disadvantages
  • Every resolver must implement the check correctly
  • Slightly more resolver code per operation
Trade-off details

Accepted per-resolver implementation cost for a single verifiable enforcement point pattern.

Future Scaling direction

Generate resolver authorization boilerplate from the schema directives.

6. DETAILED TECHNOLOGY STACK

cloud
• AWS AppSync• Amazon DynamoDB• Amazon Cognito
security
• Fine-grained Authorization• Least-Privilege IAM• Optimistic Concurrency

7. SECURITY REVIEW & POSTURE

Cross-Tenant Access Testing

The critical failure mode is one tenant reading another tenant’s tickets.

Mitigation StrategyComprehensive negative security tests attempting cross-tenant reads, writes, and subscriptions.
Least-Privilege Data Access

Over-broad table access would undermine resolver-level checks.

Mitigation StrategyIAM policies scoped to tenant partitions; documented in the authorization model.

9. ENGINEERING CHALLENGES & RESOLUTIONS

Vulnerability Bottleneck

Keeping real-time subscriptions inside tenant boundaries.

Root Cause:Subscription filters are easy to leave broad while queries are locked down.

System Investigation

Tested subscription payloads across two tenants and confirmed the scoping gap.

Engineering Solution

Bound subscription filters to the same resolved tenant context as queries.

Trade-offs accepted

More resolver plumbing for live features.

Lessons Derived

Real-time paths need the same authorization rigor as request paths.

10. SYSTEM LESSONS LEARNED

Engineering Lessons

Authorization models should be written down before resolvers, not after.

Architecture Lessons

Server-side identity derivation is the only tenant boundary you can trust.

Business Lessons

A documented authorization model is itself a deliverable enterprise buyers ask for.

System Redesign Plans

I would drive resolver checks from schema directives to remove boilerplate.

11. ROADMAP & TECHNICAL DEBT

  • Directive-driven authorization codegen
  • Tenant usage metering and quotas
  • Audit log of cross-tenant access attempts

12. GITHUB SOURCE EXPLORER

Audit raw repository script configurations directly inside the active terminal workspace.

HarizuAru/Portfoliomain
Open on GitHub
Workspace Files
1
Encoding: UTF-8Lines: 1
Let's discuss your project

Interested in building a secure auto-scaling platform similar to this?

Keep exploring

Related Projects

All projects →
Security · Cloud · DevOpsProduction

CloudTrail Threat Detection Platform

An event-driven cloud security analytics pipeline that ingests AWS CloudTrail records, applies normalization and risk scoring heuristics, and fires alert integrations under 45 seconds to secure distributed multi-tenant AWS accounts.

ArchitectureCloudTrail → S3 → Lambda → EventBridge → SNS

  • aws
  • security
  • lambda
  • eventbridge
  • siem
Security · Cloud · DevOpsPrototype

Automated Incident Response (SOAR) Pipeline

A security orchestration pipeline that detects unauthorized EC2 security group modifications via EventBridge, orchestrates response with Step Functions, isolates instances with Lambda, captures EBS forensic evidence, and publishes reports to SNS.

ArchitectureEventBridge → Step Functions → Lambda → EBS Snapshots → SNS

  • aws
  • eventbridge
  • step-functions
  • lambda
  • sns
Cloud · DevOpsPrototype

Cloud-Native Serverless Architectures

A multi-cloud serverless deployment leveraging AWS Lambda, DynamoDB, and Azure Functions to build scalable pipelines that minimize operational overhead.

ArchitectureAPI Gateway → Lambda / Azure Functions → DynamoDB / CosmosDB

  • aws
  • azure
  • serverless
  • dynamodb
  • terraform