VISTASecurity
  • Vista Platform
  • How it works
  • Insights
  • Docs
  • Release status
  • Mailing list
Try Core
Vista Documentation
  • Editions
  • Vista Platform Platform Overview
  • Cbom
    • CBOM Artifacts
  • Features
    • Algorithm Reference
    • AI Assistant Integration (MCP)
    • Asset Approval Workflow
    • Asset Lifecycle Management
    • AWS Cloud Resource Discovery
    • Azure Cloud Resource Discovery
    • Certificate Chain Management
    • CMDB Integrations
    • CMDB Terminology Glossary
    • Compliance Framework Management
    • Crypto Risks Dashboard
    • Cryptographic Keys
    • Device Interrogation Feature
    • Discovery Feature
    • Fortinet Device Interrogation
    • Viewing Frameworks, Controls & Measurements
    • GCP Cloud Resource Discovery
    • Getting Started checklist
    • Global search (⌘K)
    • Inventory and Lenses
    • Measurement Templates
    • Inviting Members
    • Infrastructure Assets and Crypto Configurations
    • Network Spaces Feature
    • Operational Context
    • Page-local Export
    • PCAP File Ingestion
    • Remediation
    • Scopes
    • Enhanced Sensor Registration & Management Guide
    • Spreadsheet Import
    • Third-Party Systems and External Connections
    • Unified Crypto Inventory
  • Guides
    • Audit Logging User Guide
    • Cloud and Device Management Separation – Migration Guide
    • Device Auto-Discovery Troubleshooting Guide
    • Device Interrogation User Guide
    • Tenant Administrator Guide
    • Tenant User Guide
  • Operating VistaPlatform
    • Container runtime images (source of truth)
    • Platform Administrator Guide
    • Releases & Versioning
    • Service Startup and Shutdown Procedures
    • Configuration
      • Platform Integrations Configuration Guide
    • Deployment Documentation
      • Database Deployment Readiness – Sensor Management Enhancements
      • Database Migration Guide
      • Device Agent Deployment Guide
      • Managed vs In-Cluster Data Services (EKS)
      • Deployment Migration Checklist
      • Production Deployment Checklist
      • Deployment Propagation Guide
      • Vista RKE2 v1 — Customer Documentation
        • Vista — RKE2 Cluster Provisioning Guide
        • Vista Deployment Guide — RKE2 v1
        • Vista RKE2 Deployment — Pre-Flight Checklist
        • Vista Security Overview — RKE2 v1
        • Vista Support Bundle
    • Monitoring
      • Compliance Engine Event Processing Alerts
      • Compliance Log Management & Retention
      • Production Monitoring & Alerting Setup
      • System Monitoring & Alerting Guide
    • Operations
      • Notification Provider Integration Guide
    • Security
      • 🔒 Security Architecture for Cloud-Hosted Control Plane
      • Bootstrap Certificate Management
      • Certificate Management Operations Guide
      • Secrets Management Guide
    • Troubleshooting
      • Asset Approval Workflow Issues – Resolution Documentation
      • Troubleshooting Guide
      • Runbooks
        • Gateway Runbook
        • Recovery and Resume After Reboot
Vista/Docs

Deployment Migration Checklist

This checklist ensures the new security and scalability improvements are properly deployed across all environments.

Pre-Deployment

Code Changes

  • RLS policies migration created (24-rls-policies.sql)
  • Table partitioning migration created (25-table-partitioning.sql)
  • RLS context middleware implemented
  • Query validation middleware implemented
  • Registration key validation strengthened
  • Development bypass security improved
  • Docker Compose files updated with new migrations
  • CI/CD pipeline updated to include new migrations

Documentation

  • Architecture improvements documented (ARCHITECTURE_IMPROVEMENTS.md)
  • Database migration guide created (docsv4/operations/deployment/database-migrations.md)
  • RDS migration script created (scripts/apply-rds-migrations.sh)

Deployment by Environment

Development (Docker Compose)

  • For existing databases: Apply RLS migration manually

    docker exec crypto-postgres psql -U crypto_user -d crypto_inventory 
      -f /docker-entrypoint-initdb.d/24-rls-policies.sql
    
  • For new databases: Migrations auto-apply on startup (already configured)

  • Verify RLS is enabled:

    docker exec crypto-postgres psql -U crypto_user -d crypto_inventory -c 
      "SELECT tablename, rowsecurity FROM pg_tables WHERE tablename IN ('sensors', 'pending_sensors');"
    
  • Deploy updated sensor-manager service

  • Test tenant isolation works correctly

  • Verify no RLS-related errors in logs

EC2-Smoke

  • Apply RLS migration (REQUIRED before deploying updated service):

    docker compose -f docker-compose.ec2-smoke.yml exec -T postgres 
      psql -U crypto_user -d crypto_inventory 
      -f /docker-entrypoint-initdb.d/24-rls-policies.sql
    
  • Verify migration success (see verification section below)

  • Deploy updated sensor-manager service

  • Run smoke tests

  • Verify tenant isolation

  • Monitor logs for errors

Production (Docker Compose)

  • Backup database before applying migrations

  • Apply RLS migration (REQUIRED):

    docker compose -f docker-compose.prod.yml exec -T postgres 
      psql -U crypto_user -d crypto_inventory 
      -f /docker-entrypoint-initdb.d/24-rls-policies.sql
    
  • Verify migration success

  • Deploy updated sensor-manager service (rolling deployment recommended)

  • Monitor service health and logs

  • Verify tenant isolation in production

  • Check performance metrics

RDS (AWS Managed PostgreSQL)

  • Backup RDS instance (automated backups should be enabled)

  • Apply RLS migration using one of these methods:

    Option A: Using migration script (Recommended)

    ./scripts/apply-rds-migrations.sh prod
    

    Option B: Manual psql connection

    export PGPASSWORD=your-password
    psql -h your-rds-instance.region.rds.amazonaws.com 
      -U crypto_user -d crypto_inventory 
      -f scripts/database/24-rls-policies.sql
    

    Option C: AWS RDS Query Editor

    • Copy contents of scripts/database/24-rls-policies.sql
    • Paste into RDS Query Editor
    • Execute
  • Verify migration success (see verification section)

  • Update application connection strings if needed

  • Deploy updated sensor-manager service

  • Monitor CloudWatch logs for RLS-related errors

  • Verify tenant isolation

EKS (Kubernetes with RDS)

  • Backup RDS instance

  • Create ConfigMap with migration files:

    kubectl create configmap db-migrations 
      --from-file=24-rls-policies.sql=scripts/database/24-rls-policies.sql 
      -n crypto-inventory
    
  • Apply migration using Kubernetes Job (see DATABASE_MIGRATION_GUIDE.md)

  • Verify migration success

  • Update sensor-manager deployment with new image

  • Monitor pod logs for RLS context errors

  • Verify tenant isolation

Verification Steps

1. Check RLS is Enabled

SELECT tablename, rowsecurity 
FROM pg_tables 
WHERE schemaname = 'public' 
AND tablename IN ('sensors', 'pending_sensors', 'sensor_discoveries', 
                  'network_assets', 'crypto_implementations');

Expected: All tables should show rowsecurity = true

2. Check RLS Policies Exist

SELECT tablename, policyname 
FROM pg_policies 
WHERE schemaname = 'public' 
AND tablename IN ('sensors', 'pending_sensors', 'sensor_discoveries', 
                  'network_assets', 'crypto_implementations');

Expected: At least one policy per table (e.g., sensors_tenant_isolation)

3. Check Security Functions

SELECT proname 
FROM pg_proc 
WHERE proname IN ('set_tenant_context', 'clear_tenant_context');

Expected: Both functions should exist

4. Test Tenant Isolation (Development/Staging Only)

-- Set tenant context
SELECT set_tenant_context('test-tenant-uuid'::uuid);

-- Query should only return data for that tenant
SELECT id, name, tenant_id FROM sensors LIMIT 10;

-- Clear context
SELECT clear_tenant_context();

5. Application Logs

Check sensor-manager logs for:

  • No RLS-related errors
  • Successful tenant context setting
  • Normal query execution
# Docker Compose
docker logs crypto-sensor-manager | grep -i "rls|tenant|error"

# Kubernetes
kubectl logs -n crypto-inventory deployment/sensor-manager | grep -i "rls|tenant|error"

Rollback Plan

If issues occur after deployment:

Immediate Rollback (Emergency)

  1. Revert service deployment to previous version
  2. RLS can remain enabled – it won't break old code (old code just won't use it)
  3. Investigate issues in staging before re-deploying

Full Rollback (If Needed)

-- Disable RLS on specific table (emergency only)
ALTER TABLE sensors DISABLE ROW LEVEL SECURITY;

-- Drop policies (if needed)
DROP POLICY IF EXISTS sensors_tenant_isolation ON sensors;

Warning: Only disable RLS in emergencies. Re-enable immediately after fixing issues.

Post-Deployment Monitoring

First 24 Hours

  • Monitor application logs for RLS errors
  • Check query performance (should be unchanged)
  • Verify tenant isolation is working
  • Monitor database connection pool usage
  • Check for any authentication/authorization issues

First Week

  • Review query performance metrics
  • Check for any tenant data leakage (security audit)
  • Verify all tenants can access their data correctly
  • Monitor database resource usage

Optional: Table Partitioning

Table partitioning (25-table-partitioning.sql) is optional and can be applied later when scaling needs arise (1000+ tenants).

When to Apply Partitioning

  • Database size > 100GB
  • Query performance degrading
  • Planning for 1000+ tenants
  • Need for tenant-level maintenance operations

How to Apply

See DATABASE_MIGRATION_GUIDE.md for detailed instructions. Partitioning requires:

  1. Creating partitioned tables
  2. Migrating data
  3. Creating views or renaming tables
  4. Testing thoroughly

Support and Troubleshooting

Common Issues

  1. "permission denied for function set_tenant_context"

    • Solution: Grant execute permission (migration should handle this)
  2. "RLS blocking all queries"

    • Check: Tenant context is being set by middleware
    • Check: Policies allow empty string for system operations
  3. "Migration fails with syntax error"

    • Check: PostgreSQL version (requires 12+)
    • Check: Migration file is complete

Getting Help

  • Review ARCHITECTURE_IMPROVEMENTS.md for architecture details
  • Review DATABASE_MIGRATION_GUIDE.md for migration procedures
  • Check application logs for specific error messages
  • Test in development environment first

Sign-Off

After completing deployment:

  • All environments migrated
  • RLS verified in all environments
  • Services deployed and healthy
  • Tenant isolation verified
  • Performance acceptable
  • Documentation updated
  • Team notified of changes

Deployment Date: _______________ Deployed By: _______________ Verified By: _______________

← Managed vs In-Cluster Data Services (EKS) Production Deployment Checklist →

View source on GitHub · Published from 470d8ee

On this page
  • Pre-Deployment
  • Code Changes
  • Documentation
  • Deployment by Environment
  • Development (Docker Compose)
  • EC2-Smoke
  • Production (Docker Compose)
  • RDS (AWS Managed PostgreSQL)
  • EKS (Kubernetes with RDS)
  • Verification Steps
  • 1. Check RLS is Enabled
  • 2. Check RLS Policies Exist
  • 3. Check Security Functions
  • 4. Test Tenant Isolation (Development/Staging Only)
  • 5. Application Logs
  • Rollback Plan
  • Immediate Rollback (Emergency)
  • Full Rollback (If Needed)
  • Post-Deployment Monitoring
  • First 24 Hours
  • First Week
  • Optional: Table Partitioning
  • When to Apply Partitioning
  • How to Apply
  • Support and Troubleshooting
  • Common Issues
  • Getting Help
  • Sign-Off
VISTASecurity

Vista Platform is a self-hosted cryptographic system of record for continuous discovery, evaluation, action, and proof.

Vista Platform

How it works
Governance
Post-Quantum
Core, Enterprise & MSP
Try Core

Resources

About
Insights
Documentation
Release status
GitHub ↗
info@vistasecurity.io
Join the mailing list

© 2026 Lakeshore Labs LLC. Vista Security is a brand of Lakeshore Labs LLC. All rights reserved.