Skip to content
LogoLogo

What SaaSLayer can do in your AWS account

Connecting an AWS account to SaaSLayer installs the SaaSLayer foundation: two CloudFormation stacks that give SaaSLayer the access it needs to deploy and support its services in your account, and nothing else. This page describes foundation version 11.1.0 (the saaslayer-foundation stack) and region stack version 1.5.0 (saaslayer-foundation-<region>), the versions the current saaslayer CLI installs.

To see which version your account runs:

saaslayer aws foundation status --region us-east-1 --profile saaslayer-bootstrap

The FoundationVersion output of the saaslayer-foundation stack shows it too.

Permission modes

The foundation runs in one of two permission modes. You choose it; SaaSLayer can't change it.

  • Scoped (the default): permissions limited to SaaSLayer-managed resources. Everything below describes this mode. When a new SaaSLayer feature needs a new permission, you upgrade the foundation to get it.
  • Broad: account-wide resource permissions, with restricted IAM management. New SaaSLayer features need fewer foundation upgrades. Use it only in an account you own or have dedicated to SaaSLayer.

In broad mode, the deploy role and the CloudFormation role also carry the AWS managed policy PowerUserAccess (every action except IAM, Organizations and account management), and the services' permissions boundary allows the same. IAM stays as in scoped mode: SaaSLayer can only create sl- roles, and only with a SaaSLayer permissions boundary. The support role, the end-user boundary and every trust policy stay the same, and no restriction of scoped mode is removed.

A Deny-only policy, sl-foundation-broad-guardrails, and the same statements in the permissions boundary keep SaaSLayer's roles from:

  • writing the /saaslayer/foundation/ parameters, which say who may connect the account;
  • changing CloudFormation hooks and registered types, including the template guard;
  • assuming any role whose name doesn't start with sl-;
  • writing CloudFormation stacks, Lambda functions, CodeBuild projects or Step Functions state machines whose names don't start with sl-, the foundation stacks included;
  • running commands, sessions or automations on your EC2 instances.

These limits apply to calls SaaSLayer's own roles make. Broad mode still lets SaaSLayer change your other resources, and some AWS services act with the role already attached to a resource. The list above blocks the known ways to borrow such a role, but not every possible one. That's why broad is for accounts you own or have dedicated to SaaSLayer. SaaSLayer refuses broad on an account that hosts other customers' deployments.

To switch, with the credentials you connected with:

saaslayer aws foundation upgrade --region <home-region> --permission-mode broad --profile saaslayer-bootstrap

--permission-mode scoped switches back. A first saaslayer aws connect takes --permission-mode too. The console's Accounts page shows each account's mode.

The full policies

Every policy is public. Read them before you connect:

The saaslayer npm package ships the same files, with comments explaining each statement, under templates/. The CLI refuses to install a published template that differs from the copy it ships. Known limits and the hardening roadmap are shared on request: contact us.

Who can do what

The foundation trusts exactly one SaaSLayer control plane: one AWS account (ControlPlaneAccountId), its two identity roles (<ControlPlaneId>-deploy and <ControlPlaneId>-support) and the trust identifiers SaaSLayer holds for your account (ControlPlaneTrustIdentifiers, used as the STS external ID). Those are stack parameters you can read in CloudFormation.

sl-foundation-deploy-role: deployments

SaaSLayer's deployer assumes this role to deploy, update and remove its services. It's the only way SaaSLayer writes to your account.

  • It manages only CloudFormation stacks whose names start with the stack prefix (sl- by default), and creates or updates them only through sl-foundation-cfn-exec-role. It can't touch your other stacks.
  • It can't create IAM roles or policies. Its only iam:PassRole is sl-foundation-cfn-exec-role, to CloudFormation.
  • Its direct writes reach only sl--named resources (buckets, tables, functions, log groups, secrets) or resources tagged managed-by=saaslayer-deployer (user pools, KMS keys, certificates, API Gateway domains and stages, CloudFront distributions).
  • It reads objects only from the deployment artifact buckets, never from your services' data buckets.
  • It reads and updates the configuration of sl- functions (to install and rotate the deployment's secrets), invokes their -seed functions, and reads and writes SSM parameters under /saaslayer/deployment/.
  • To seed a deployment (its first administrator and setup records), it can create and update users in user pools tagged managed-by=saaslayer-deployer and read and write items in sl- tables.
  • It may assume a service's own sl-…-migrate role, which is limited to that service's tables, to run data migrations.

Its policy also has a second part, the managed policy sl-foundation-deploy-policy (inventory reads, cleanup of sl- resources and certificates for custom domains).

sl-foundation-cfn-exec-role: CloudFormation

Only the CloudFormation service can assume this role, and only sl-foundation-deploy-role can hand it to CloudFormation. CloudFormation uses it to create the resources SaaSLayer's service templates declare: sl--named resources, or user pools, identity pools, KMS keys, distributions and secrets tagged managed-by=saaslayer-deployer. Part of its policy is the managed policy sl-foundation-cfn-exec-policy. It can't change any sl-foundation-* policy.

sl-foundation-support-ro-role: support

SaaSLayer support assumes this role to diagnose problems. Every session name must start with saaslayer-support-.

  • Get, List and Describe only, on SaaSLayer's stacks and on resources tagged managed-by=saaslayer-deployer where AWS supports that condition.
  • It reads the log output of SaaSLayer's functions (/aws/lambda/sl-*), never your own log groups.
  • It reads SMS and email sending readiness (account-level SES and SMS settings), alarm state and dashboards.
  • It reads nothing that carries a secret or your data: no stack templates, no function configuration or code, no app client secrets, no API key values, no S3 objects, no DynamoDB items, no SSM parameter or Secrets Manager values. Explicit Deny statements keep it that way, whatever else is attached to the role.

Support reads a deployment's settings from SaaSLayer's control plane, with secrets redacted, not from your account.

Permissions boundaries

Every IAM role a SaaSLayer service creates carries one of two permissions boundaries. Whatever the role's own policy says, it can't do more than its boundary allows.

  • sl-foundation-scoped-boundary: the runtime actions SaaSLayer services use (user pool administration, DynamoDB items, S3 objects, queues, schedules, function invocation, logs, email and SMS sending), on SaaSLayer's resources only (sl- names, managed-by user pools and keys, /saaslayer/deployment/ parameters, this account). In broad mode, every action except IAM, Organizations and account management, within the guardrails.
  • sl-foundation-web-identity-boundary: for the roles your app's end users receive through a Cognito identity pool. It allows only calling API Gateway APIs in this account.

The production console's WebSocket connect role can also read its existing /saaslayer/control-plane/event-bus-connect-ticket-key SecureString in its own account. This exception names that exact role and parameter; other service roles receive no access to it. Decryption is limited to that parameter through SSM.

What else the stacks hold

  • The SSM parameter /saaslayer/foundation/connection-authorizers: who may connect this account to SaaSLayer organizations, and which control plane manages it. No secret.
  • The region stack's deployment artifact bucket (sl-artifacts-…). Only sl-foundation-deploy-role among SaaSLayer's roles may write to it; your own principals keep full control.

What SaaSLayer knows about your account

SaaSLayer may know about the resources it created, by name. It doesn't collect anything about your users or your other resources. Reports that SaaSLayer tooling produces from your account stay with you unless you share them.

Audit SaaSLayer's access

Every entry is an sts:AssumeRole event in your account's CloudTrail:

  • Deploy sessions are named saaslayer-*; support sessions saaslayer-support-*.
  • The session may carry a saaslayer.<deploymentId> source identity and deploymentId and stackPrefix session tags, naming the deployment it works on.

To filter them, search CloudTrail event history for AssumeRole events whose resource is sl-foundation-deploy-role or sl-foundation-support-ro-role. Every resource SaaSLayer deploys is tagged managed-by=saaslayer-deployer, deploymentId, customerId and moduleName.

To cut SaaSLayer off, delete the saaslayer-foundation stack. Your deployments keep running, but SaaSLayer can no longer update or support them.

Secrets in your deployments

SaaSLayer generates each deployment's secrets (signing keys, service keys and API keys) and keeps them encrypted in its control plane. Each deployment delivers them to its functions one of two ways.

Environment delivery (the default). The secrets are Lambda environment variables:

  • Signing key rings, the key a service uses to call Permissions, and the hashes of integration credentials are written into the functions' configuration after each deploy. They never appear in a template.
  • Other generated secrets, such as a service's admin API key or webhook signing key, are part of the function's environment in the stack's template.

Anyone in your account who can read the function's configuration (lambda:GetFunctionConfiguration or lambda:GetFunction), the stack's template (cloudformation:GetTemplate), or the packaged templates in the sl-artifacts-… bucket (s3:GetObject) can read those secrets. That includes roles with AWS's managed SecurityAudit policy, which security scanning tools often use: it grants lambda:GetFunctionConfiguration and cloudformation:GetTemplate. Of SaaSLayer's roles, sl-foundation-deploy-role can read them, because it installs them. sl-foundation-support-ro-role can't: foundation 9.0.0 removed its access to templates and function configuration and denies it explicitly.

SSM delivery. The secrets are SSM SecureStrings under /saaslayer/deployment/<deploymentId>/, and functions read them at runtime. No secret is in a template, a function's configuration or a deployment file. Reading one needs ssm:GetParameter on that path and KMS decrypt through SSM: each function's own role, sl-foundation-deploy-role (which writes them), and your own administrators. Support is denied. Users and Permissions support SSM delivery; to switch a deployment, contact us.

SaaSLayer-owned accounts

When SaaSLayer hosts your deployment in an AWS account it owns, that account belongs to SaaSLayer's AWS Organization. Like every account created in an organization, it has OrganizationAccountAccessRole, which gives full administrator access to principals in SaaSLayer's organization management account. SaaSLayer uses it to set up the account and change its foundation. Accounts you own and connect don't have that role from SaaSLayer.

Upgrade notes

saaslayer aws foundation status shows upgrade available when the CLI ships a newer foundation than your account runs. To upgrade, with the same credentials you connected with:

saaslayer aws foundation upgrade --region <home-region> --profile saaslayer-bootstrap

The CLI shows the CloudFormation change set and asks before applying it. It keeps every parameter value, then asks SaaSLayer to re-read the account.

11.1.0

sl-foundation-cfn-exec-role can read the tags of an identity pool carrying managed-by=saaslayer-deployer. CloudFormation drift detection reads them, so a protected (staging or prod) update can verify every resource before it starts. No other permission changes.

11.0.0

The deployment role admits only a SaaSLayer session tagged for one deployment (its deploymentId and stackPrefix, with source identity saaslayer.<deploymentId>), so every deployment action is bound to the deployment it serves. Account-level checks (connecting the account, trust rotation, health) use the read-only support role, which can now also read the connection-authorizers parameter. A stack the deployment role creates or updates can carry only its own deployment's tags. Requires a SaaSLayer control plane that tags its sessions; no resource is deleted.

Region stack 1.5.0

The template guard (when you turned it on with --template-guard warn) checks two more things in SaaSLayer stacks: a role takes its deploymentId and stackPrefix tags only from its stack's tags, and a resource policy admits principals from this account only. The guard stays in warn mode: it reports, and never blocks a deployment. No permission changes.

10.3.0

Broad mode no longer blocks SaaSLayer deployments whose templates use the AWS::LanguageExtensions transform. Its guardrail against writing stacks outside the managed prefix also matched the AWS-owned transform that such a template is expanded with. Stacks outside the prefix are still never written. No change in scoped mode.

10.2.0

Adds the permission modes. The new PermissionMode parameter defaults to scoped, so an upgrade changes no permission. Choose broad with --permission-mode broad.

10.1.0

Fresh Users deployments can pass their SMS role to Cognito when its permission check omits iam:PassedToService. This exception covers only this account's managed roles ending in -snsSendRole or -phoneSms. If the condition key is present, it must name Cognito. The roles keep their existing trust and runtime permissions boundary; other managed roles still require a recognized service.

10.0.2

The template's security reviewer summary now states every limit the execution role works under (which roles it may write, what module resources may point at, the tag it can never add) and the three optional capability switches. No permission changes.

10.0.1

The scoped boundary permits the production console ticket verifier to read its existing key. Other roles, parameters and accounts remain outside this exception. It does not change trust, add resources or rotate the key.

10.0.0

10.0.0 removes the compatibility 9.0.0 kept and limits SaaSLayer to what its services use. What changes:

  • One deployment per session. SaaSLayer tags every session it opens with the deployment it acts for (its id and stack prefix). sl-foundation-deploy-role reaches only that deployment's stacks, functions, tables, log groups, migration roles and /saaslayer/deployment/<id>/ parameters; a session without the tags reaches none of them.
  • No seed data access. The deploy role no longer creates user pool users or writes table items: each service seeds itself through its own seed function.
  • The earlier managed boundary is removed. Every service role runs under sl-foundation-scoped-boundary or sl-foundation-web-identity-boundary; the ManagedResourceBoundaryArn output names the scoped boundary.
  • sl-foundation-cfn-exec-role narrowed. It changes a role only when the role carries a SaaSLayer boundary, attaches only sl- policies and hands roles only to Lambda and Cognito. Function invoke permissions only for API Gateway, Cognito, EventBridge and SES; event targets and event source mappings only into sl- functions; topic subscriptions only to queues. It can't administer user pool users or add identity providers, can't add the managed-by tag to a resource that lacks it, writes no S3 objects and reads only SaaSLayer parameters.

What you do: run saaslayer aws foundation upgrade once SaaSLayer offers it. It is offered only after your deployments run the service releases it needs.

9.4.0

9.4.0 lets sl-foundation-deploy-role carry its deployment's session tags and source identity into a module's own data-migration role (sts:TagSession and sts:SetSourceIdentity, on the same *-migrate roles it could already assume). SaaSLayer tags every deploy session with the deployment it acts for; AWS requires these two permissions for that tagged session to continue into the migration role. 10.0.0 includes it.

9.3.0

9.3.0 lets CloudFormation delete the runtime EventBridge Scheduler schedules in a managed schedule group when it removes that group during teardown.

9.2.0

9.2.0 lets sl-foundation-deploy-role request a certificate with the managed-by=saaslayer-deployer tag. ACM also checks its certificate-tagging permission when a request includes tags. The managed login-domain step needs this to prepare a new user's sign-in host. The region stack stays at 1.4.1.

9.1.0

9.1.0 gives sl-foundation-deploy-role back cloudformation:DetectStackResourceDrift on SaaSLayer's stacks, which the drift check before each update needs. Upgrade straight to 9.1.0; 9.0.0 isn't offered. The region stack is 1.4.1.

9.0.0

9.0.0 adds the boundaries and trust options the next releases build on, and removes access SaaSLayer doesn't use. What changes:

  • Trust comes from three parameters: ControlPlaneAccountId, ControlPlaneId and ControlPlaneTrustIdentifiers. Every account runs the same template. The upgrade converts the earlier TrustEntries parameter for you. A foundation that trusts more than one control plane can't be converted: the upgrade names them and stops. Remove the extras first.
  • Installed from its published URL. The template is larger than CloudFormation accepts inline, so the CLI installs it from the published copy after checking it matches the copy it ships.
  • sl-foundation-deploy-role narrowed. Stacks are created and updated only through sl-foundation-cfn-exec-role; no object reads from services' data buckets; function reads only on sl- functions; no layers attached outside a deploy. It may now invoke sl-…-seed functions. Part of its policy moved to the managed policy sl-foundation-deploy-policy.
  • sl-foundation-support-ro-role reads no secrets. No stack templates, function configuration, function versions, app client details or stack policies, enforced by explicit Deny statements.
  • Two boundaries added: sl-foundation-scoped-boundary and sl-foundation-web-identity-boundary. The earlier managed boundary stays until no role uses it.
  • Optional session tags and source identity on both cross-account roles. Sessions without them keep working.
  • sl-foundation-cfn-exec-role loses actions no SaaSLayer service uses and can't change any sl-foundation-* policy.
  • Region stack 1.4.1: the artifact bucket enforces bucket-owner object ownership, and denies writes by every sl- role except sl-foundation-deploy-role.

What you do: run saaslayer aws foundation upgrade and review the change set. Your deployments need nothing; each service moves its roles to the new boundaries on its next update.

10.0.0 removes the compatibility 9.0.0 keeps (above). Upgrade to 9.3.0 first.