saas · · 14 min read

Design the SaaS Exit Before Signing the Contract

A practical exit architecture for recovering data, identities, logs, keys, integrations, and operating continuity from a SaaS provider.

Design the SaaS Exit Before Signing the Contract

The easiest time to leave a software-as-a-service provider is before the first production record enters it.

That sounds backwards. Procurement is trying to start a service, not end one. Engineering is validating features. Security is reviewing authentication, encryption, logging, and supplier risk. Legal is negotiating liability and data terms. Nobody wants to slow an implementation with a hypothetical migration years away.

The exit is not hypothetical.

A contract expires. Prices change. A product is acquired. A feature is retired. A provider suffers an outage or security event. Regulatory scope changes. The service no longer supports the architecture. The organization decides to bring a capability in-house. Even a successful long-term relationship eventually reaches data disposition.

If the exit was not designed at entry, the provider's current export, API, identity, and retention behavior becomes the migration architecture. That is a poor time to discover that an export omits comments, the API allows 500 requests per hour, audit logs are retained for 30 days, encryption keys cannot be separated, or terminated users own records that nobody else can export.

NIST SP 800-161 Rev. 1 treats cybersecurity supply-chain risk as an organization-wide lifecycle discipline for systems and services. NIST SP 800-53 Rev. 5 includes controls for external system services, contingency planning, information-system backup, audit records, account management, and media sanitization. The point is not that those publications mandate one exit template. The point is that supplier dependency, continuity, evidence, identity, and disposition are architecture concerns before they become contract disputes.

Define exit acceptance before purchase

I start with a short acceptance statement that procurement, the service owner, security, records management, and legal can all read.

Define exit acceptance before purchase
saas_exit_acceptance:
  service: candidate-saas
  business_owner: named-role
  data_owner: named-role
  exit_modes:
    - planned_termination
    - provider_failure
    - security_isolation
    - contract_dispute
  recovery_point_objective: 24h
  continuity_target: 72h
  export:
    full_fidelity: required
    machine_readable: required
    incremental: required
    documented_schema: required
  identities:
    independent_admin_access: required
    service_accounts_inventory: required
  evidence:
    audit_log_export: required
    configuration_export: required
  disposition:
    deletion_certificate: required
    backup_expiration_statement: required
  exercise:
    before_production: required
    frequency: annual

The values will differ. A payroll, clinical, legal, or security service needs tighter requirements than a low-impact survey tool. The important move is converting "the vendor says exports are available" into testable acceptance criteria.

An exit plan is not a promise to self-host everything. It is a way to preserve choices.

Threat model the dependency

Threat model the dependency

The SaaS boundary contains more than application data. I inventory at least:

  • primary records and attachments
  • comments, versions, labels, relationships, and workflow state
  • users, groups, roles, ownership, and delegated administration
  • SAML, OIDC, SCIM, directory synchronization, and local break-glass accounts
  • API clients, webhooks, robots, service accounts, and OAuth grants
  • audit, access, administrator, and security logs
  • encryption keys, customer-managed key references, certificates, and secrets
  • dashboards, reports, saved searches, rules, templates, and configuration
  • retention rules, holds, archived records, and deleted-item queues
  • downstream integrations, data warehouses, SIEM feeds, and automation
  • domain names, email routes, mobile applications, browser extensions, and endpoints
  • billing, license assignment, and support identities

Then I draw the failure paths. What happens if the normal API is unavailable? What if the identity federation path is down? What if the provider suspends the tenant? What if only a read-only administrative session remains? What if the organization must stop new processing while preserving records under legal hold?

CISA's Cloud Security Technical Reference Architecture frames cloud adoption around shared services, visibility, identity, and security architecture across cloud boundaries. An exit design uses the same boundary discipline in reverse. Every inbound dependency needs a replacement or an intentional shutdown, and every outbound dependency needs a way to continue or fail safely.

"Export supported" is not a requirement

An export must be described precisely.

"Export supported" is not a requirement

Ask the provider for a field-level manifest of what is included and excluded. Test primary records, attachments, comments, history, custom fields, deleted objects, users, group memberships, roles, labels, timestamps, references, and configuration. Preserve stable identifiers. If records reference each other, the export needs enough keys to rebuild those relationships.

The export contract should state:

The following fields are proposed acceptance and contract terms, not assumptions about provider behavior. Feasibility, cost, jurisdiction, product edition, and exceptions must be verified and any gap explicitly accepted.

export_contract:
  scope:
    records: all
    attachments: all
    versions: required
    comments: required
    relationships: required
    audit_logs: required
    configuration: required
  representation:
    tabular: csv_utf8
    structured: json_utf8
    bulk_analytics: parquet_if_supported
    attachments: original_bytes
    timestamps: rfc3339_utc
    checksums: sha256_manifest
  identifiers:
    provider_object_id: preserved
    external_id: preserved
    relationship_keys: documented
  delivery:
    full_export: on_demand
    incremental_export: cursor_or_time_window
    encryption_in_transit: required
    encryption_at_rest: required
    resumable: required
  validation:
    schema_version: included
    record_counts: by_object_type
    error_manifest: required
    reproducible_query: required

CSV is portable for simple tables, but it does not naturally preserve nested structures, binary attachments, rich types, or relationships. RFC 4180 documents a common CSV format, while also reflecting how limited the format is. JSON is better for structured and nested application objects; RFC 8259 defines its interoperable syntax and encoding expectations. Apache Parquet is useful for typed, columnar, high-volume analytical data, but it is not a universal application interchange format and does not solve attachment or workflow semantics.

PDF is a useful human-readable report. It is usually a poor recovery format. Screenshots are evidence for a specific view, not a tenant export. A proprietary database dump may be complete but useless without the product schema and compatible software.

Portable means another system can parse the data, understand its schema, preserve key semantics, and verify completeness.

API limits become migration limits

Many exit plans say "use the API" without doing throughput arithmetic.

API limits become migration limits

The plan needs the documented and measured limits for requests, records per page, attachment size, concurrent jobs, daily bulk exports, historical windows, cursor lifetime, retry behavior, and provider-side job expiration. It also needs the tenant's current object and byte counts. A rate limit that is comfortable for normal integration traffic may turn a full extraction into a multi-week process.

I test:

  1. full enumeration without relying on a user interface
  2. pagination while records are changing
  3. restart after an expired token or failed page
  4. incremental capture after the baseline export
  5. large attachment download and checksum validation
  6. tombstones or deleted-record representation
  7. throttling and Retry-After behavior
  8. export under a least-privileged service identity
  9. extraction while normal users continue working
  10. final delta after a controlled write freeze

An API that returns 200 OK has not proven completeness. Reconcile counts by object type, compare sample relationships, verify attachment digests, and record explicit exclusions.

Contract language should prevent the provider from reducing export capability, historical depth, or practical throughput without notice. It should also define an escalation route for a bulk extraction that ordinary quotas cannot support.

Identities have to come out too

Application records often point to people. If the export contains only display names, duplicate names and changed names will corrupt ownership. Preserve immutable provider IDs, external directory IDs where present, usernames, email addresses, status, group membership, role assignment, and ownership history according to policy.

Identities have to come out too

Do not export password hashes from a SaaS provider and expect to reuse them. In a federated design, the enterprise identity provider remains authoritative and the replacement service establishes a new trust. Local break-glass accounts should be inventoried and retired explicitly. SCIM deprovisioning must be controlled during transition so a synchronization job does not disable the last migration administrator.

Keycloak can be an appropriate open-source identity provider when the organization needs self-managed OIDC, OAuth 2.0, SAML, realm configuration, and federation capabilities. Its realm import and export functions are useful for Keycloak configuration and users, with documented operational constraints. They do not make a third-party SaaS application's roles, ownership model, or proprietary authorization semantics portable.

I keep an identity translation table:

identity_mapping:
  - provider_subject: usr_8f27a
    enterprise_subject: 2f1d5d58-4f97-4ca0-a508-8e74b62dd939
    replacement_subject: pending
    former_roles: [case-admin]
    record_ownership_count: 184
    migration_disposition: map_and_validate

This is also where privacy minimization belongs. Do not carry every historical identity attribute into the replacement simply because it is present.

Logs are part of the service record

Audit logs are often licensed, retained, and exported differently from application data. Determine which events exist, what fields they carry, how long they remain online, whether the API exposes the same detail as the user interface, and whether administrator and provider-support actions are visible.

Logs are part of the service record

Export logs continuously to an organization-controlled destination when the service risk justifies it. Waiting until termination may be too late. Preserve event IDs, actor and target identities, timestamps, source information, action, result, tenant, and provider-specific context. Record clock format and time zone.

The final log capture should cover the migration itself: export creation, elevated access, bulk reads, configuration changes, integration cutover, user disablement, and provider deletion actions. The evidence chain should not stop immediately before the most sensitive administrative work.

OpenSearch can be appropriate for searchable retained logs when the organization already operates it and can govern the data. Object storage can be more economical for immutable or infrequently searched archives. Do not deploy a search cluster solely because the old SaaS had a dashboard. Retention, query frequency, investigation needs, and operating skill should drive the destination.

Keys and secrets need a custody decision

"Customer-managed encryption keys" can describe several different arrangements. The customer may own a cloud KMS key while the provider controls encryption context and service integration. The provider may support bring-your-own-key but retain data-encryption keys in caches or backups. Key revocation may make data unavailable without proving every copy has been deleted.

Keys and secrets need a custody decision

Before signing, document:

  • who creates, owns, uses, rotates, disables, and destroys each key
  • which data classes and tenant scopes each key covers
  • what happens to availability when a key is disabled
  • how exports are encrypted and how the recipient receives the key
  • whether provider backups, replicas, indexes, and logs use the same key path
  • which certificates and API secrets must be rotated at cutover
  • whether any secret is shared with another integration or environment

The exit should revoke provider access without accidentally destroying the only readable export. Sequence matters: create and validate the export, transfer custody, verify restoration, stop writes, capture the final delta, revoke integrations, and then execute the approved key and deletion actions.

Never copy live secrets into an exit document. Record secret object identifiers, owners, scope, rotation status, and evidence.

Termination does not erase legal, regulatory, contractual, or investigative obligations. Records under hold must remain preserved even while ordinary processing stops. Conversely, an indefinite archive created "just in case" may violate minimization and retention policy.

Legal hold and retention can override deletion

The General Data Protection Regulation includes rights and obligations concerning erasure, restriction of processing, and data portability, subject to conditions and exceptions. Counsel and the data protection officer must determine applicability. Architecture must make their decision executable.

The plan needs separate states:

ACTIVE -> READ_ONLY -> EXPORTED -> VALIDATED -> ACCOUNT_TERMINATED
              |
              +-> LEGAL_HOLD -> HOLD_TRANSFERRED | HOLD_RELEASED
                                      |
                                      +-> DISPOSITION_AUTHORIZED

ACCOUNT_TERMINATED + DISPOSITION_AUTHORIZED
  -> PROVIDER_DELETION_PENDING -> BACKUP_EXPIRY_PENDING -> CLOSED

A held record should not vanish during bulk deletion. A restricted record should not continue through ordinary workflows. The export should preserve hold identifiers, custodians, dates, scope, and chain-of-custody metadata without relying on undocumented provider flags.

Ask how retention applies to primary storage, soft-deleted records, replicas, backups, support copies, telemetry, subprocessors, and disaster-recovery environments. "Deleted from production" is only one state.

Integrations are hidden contract terms

A SaaS product becomes sticky through integrations as much as data. Webhooks, API clients, workflow automations, browser extensions, mobile applications, email ingestion, DNS records, SIEM feeds, reporting jobs, and data-warehouse pipelines all encode assumptions about the provider.

Integrations are hidden contract terms

Maintain an integration register from day one:

Field Purpose
owner Names the person responsible for cutover
producer and consumer Shows direction and authority
data and action class Distinguishes telemetry from privileged changes
identity and secret Supports rotation and revocation
endpoint and protocol Supports replacement and negative testing
retry and queue behavior Reveals delayed calls after cutover
replacement or retirement Prevents orphaned dependencies
acceptance evidence Defines what proves the new path works

For each integration, decide whether to replace, transform, absorb, or retire it. A compatibility proxy can buy time, but it can also preserve the old provider's data model indefinitely. Put an expiration date on transitional adapters.

Select the replacement by control objective

Exit planning should identify replacement classes, not prematurely nominate one product.

Select the replacement by control objective

Nextcloud can be a reasonable open-source destination for files and collaborative access when WebDAV-based file interoperability and self-managed storage fit the requirement. Nextcloud documents its WebDAV interfaces for file access. It is not a drop-in replacement for a specialized case-management, HR, CRM, or security-analysis SaaS platform. Moving attachments to Nextcloud does not recreate workflow state.

S3-compatible object storage under organizational control can be appropriate when tested object-lock, versioning, retention, legal-hold, backup, and restore semantics meet the requirement. MinIO needs an edition-specific decision: current AIStor documentation describes the commercial product, while the former AGPL community server repository was archived in 2026 and is no longer an actively maintained community choice. Neither edition provides records classification, custodianship, matter management, or a complete legal-hold program by itself.

Keycloak can replace or centralize an identity-provider function. It does not replace the SaaS business application.

Open-source software can improve inspectability, deployment choice, and control over data location. It also transfers patching, backup, recovery, availability, capacity, security monitoring, and upgrade responsibility to the operator. A rushed exit is the worst time to discover that "we can self-host it" meant "we can start a container."

The replacement acceptance should compare required capabilities, data semantics, authorization, auditability, recovery, operating cost, staffing, support, and migration evidence. Feature count alone is not architecture.

Negotiate termination assistance as a deliverable

Negotiate termination assistance as a deliverable

Termination assistance should not be a vague promise of cooperation. Define:

  • notice periods and access duration after notice
  • continued read and export access during a dispute
  • named technical and escalation contacts
  • full and incremental export mechanisms
  • schema and data-dictionary delivery
  • quota relief and bulk-export support
  • provider engineering hours included and their rates
  • configuration, log, identity, and attachment scope
  • support for final delta and write freeze
  • subprocessor disposition
  • deletion timing and evidence
  • backup expiration timing
  • support for audit, regulator, or litigation obligations
  • assistance if the provider ceases operations

Set pricing before dependency forms. An export that is technically available but commercially punitive is not a reliable exit path.

The contract should also require notice of material changes to APIs, export formats, retention, key management, authentication, subprocessors, and product end-of-life. A design cannot remain portable if the interface changes silently.

Proof of deletion needs defined evidence

A provider cannot usually prove physical bit-level erasure of every historical copy immediately. The useful requirement is a precise, accountable disposition statement.

Proof of deletion needs defined evidence

I ask for evidence that identifies:

  1. the tenant and data scope
  2. the deletion request and approval
  3. production deletion completion time
  4. replica and cache disposition
  5. subprocessor notification and completion
  6. backup retention and scheduled expiry
  7. legal or regulatory exceptions
  8. cryptographic-key disposition where applicable
  9. the accountable provider role
  10. any residual metadata retained and its basis

NIST SP 800-53's media-protection and sanitization controls provide a useful control context, but the contract and provider architecture determine what evidence is actually available. A certificate saying "data deleted" without scope, dates, exceptions, or backup treatment is weak evidence.

Verify externally visible effects too. Old credentials should fail. Webhooks should stop. Tenant URLs should no longer expose data. Federated access should be disabled. DNS and email routes should point only to the intended replacement or return the intended negative response.

Continuity requires an operating mode, not only an export

Data in a bucket does not continue a business process.

Continuity requires an operating mode, not only an export

The continuity plan must say how the organization will receive new work, find current records, authorize users, perform critical actions, and preserve evidence while the SaaS is unavailable or being replaced. NIST SP 800-34 Rev. 1 provides contingency-planning guidance built around business impact, recovery strategies, plans, testing, training, and maintenance.

For each critical process, define a minimum continuity mode:

continuity_mode:
  process: security-case-management
  trigger: saas_unavailable_over_4h
  intake: controlled-mailbox-and-queue
  read_access: last-validated-export
  write_system: temporary-case-register
  identity: enterprise-idp
  privileged_actions: manual-dual-approval
  evidence_store: organization-controlled-object-storage
  reconciliation: scripted-with-human-review
  maximum_duration: 72h
  owner: incident-response-manager

A temporary spreadsheet may be acceptable for a small, low-volume process. It may be reckless for regulated records or concurrent privileged work. Choose the fallback based on consequence and test it under realistic load.

Run the tabletop before production

I want one exit tabletop and one technical extraction exercise before the service becomes authoritative. Then repeat them on a schedule and after material changes.

Run the tabletop before production

The scenario should remove a comfortable assumption. Examples include an unavailable primary administrator, a suspended tenant, an API limited below the expected rate, a provider outage during the final delta, an active legal hold, or a compromised integration credential during cutover.

Participants should include the business owner, application team, identity team, security operations, records or privacy personnel, procurement, legal, and the people who operate the replacement or fallback.

The exercise should answer:

  1. Who declares exit or continuity mode?
  2. How do administrators authenticate if federation fails?
  3. What is the latest organization-controlled copy?
  4. How long will full extraction take at measured limits?
  5. Which records cannot be represented in the chosen format?
  6. How are legal holds preserved?
  7. Which integrations can still create side effects?
  8. How are users redirected and informed?
  9. What proves the replacement is authoritative?
  10. What proves the old tenant has stopped processing data?
  11. Who accepts reconciliation errors and residual risk?
  12. What contract clause is invoked when technical cooperation fails?

Close the exercise with owners and dates. A tabletop that produces only observations is a meeting, not a control.

The pre-signature checklist

The pre-signature checklist

I would not approve a material SaaS dependency until these items have evidence or an accepted exception:

  • Data inventory includes records, attachments, versions, relationships, and configuration.
  • Full and incremental exports are machine-readable and tested.
  • Export schemas, identifiers, timestamps, and exclusions are documented.
  • API limits and full-extraction duration are measured against expected scale.
  • Counts, relationships, and checksums can be reconciled.
  • Identity and role mappings preserve stable subjects and ownership.
  • Independent or break-glass administration is tested and governed.
  • Audit logs leave the provider continuously where required.
  • Keys, certificates, API clients, OAuth grants, and secrets have exit actions.
  • Legal hold, restriction, retention, and deletion states are defined.
  • Every integration has an owner and replacement or retirement decision.
  • The replacement class and minimum continuity mode are documented.
  • Termination assistance has scope, timing, contacts, and pre-agreed cost.
  • Provider and subprocessor deletion evidence is contractually defined.
  • Backup expiration and residual metadata are addressed.
  • A tabletop and technical extraction exercise pass before production.
  • The plan has an owner, review date, and material-change trigger.

Architecture before leverage disappears

The SaaS exit belongs in the initial design because that is when the organization has the most leverage and the least accumulated dependency.

Architecture before leverage disappears

This is consistent with the architecture argument I make throughout Cybersecurity Architect's Handbook, Second Edition: boundaries, identities, data paths, control authority, failure states, and recovery evidence should be designed together. A supplier does not remove those responsibilities. It changes which controls are implemented directly, which are shared, and which must be secured by contract and verification.

I do not need every SaaS product to be replaceable in a weekend. I need the organization to know what will be recovered, how long it will take, which semantics will be lost, how critical work continues, what the provider must do, and what evidence closes the relationship.

If those answers arrive only after termination notice, the contract has already made several architecture decisions for us.

Read next