Docs

Permissions

This page lists every permission setting in alien.ts: the profiles your workloads run as, Alien's management access, and every built-in permission set. The management identity is the scoped cloud identity the customer's admin creates at initial setup, their one-time step, so Alien can update the deployment afterwards.

Nothing is granted unless you declare it, and each grant becomes a native cloud policy the customer can review.

alien.ts
import * as alien from "@alienplatform/core"

const data = new alien.Storage("data").build()
const cache = new alien.Kv("cache").build()

const api = new alien.Worker("api")
  .code({ type: "source", src: "./api", toolchain: { type: "typescript" } })
  .permissions("execution")
  .build()

export default new alien.Stack("acme")
  .add(data, "frozen")
  .add(cache, "frozen")
  .add(api, "live")
  .permissions({
    profiles: {
      execution: {
        data: ["storage/data-read", "storage/data-write"],
        cache: ["kv/data-read", "kv/data-write"],
      },
    },
  })
  .build()

The execution profile becomes one cloud identity, and api runs as it with read and write access to data and cache only.

Permission layers

LayerWho holds itComes from
ProvisioningThe customer's admin, once at initial setupDerived from the stack. Alien never holds it.
ManagementAlien's management identity, for ongoing management: updates and health checksDerived from live resources and enabled features. Adjust with management.
RuntimeYour workloadsPermission profiles

Profiles

A profile maps resource ids to permission sets. Workloads pick one with .permissions("<name>").

PlatformA profile becomes
AWSIAM role
Google CloudService account
AzureUser-assigned managed identity
KubernetesKubernetes ServiceAccount from the Helm chart

AWS limits apply to each role:

LimitValueBuild error when exceeded
Inline policies per role10,240 charactersIAM_INLINE_POLICY_SIZE (a profile's stack-wide grants), IAM_WORKLOAD_INLINE_AGGREGATE (all inline policies initial setup writes to one role)
Managed policies per role20 (AWS's default quota)Generated templates never attach more

Scopes

alien.ts
profiles: {
  execution: {
    "*": ["storage/data-read"],
    "logs": ["storage/data-write"],
  },
}
KeyScope
"*"Every resource of the set's type in the stack's scope
"<resource id>"That resource only
AspectAWSGoogle CloudAzure
Stack scopeARN wildcards on the stack's name prefixProject-level IAMResource group
Resource scopeThe resource's ARNIAM policy on the resourceRole assignment on the resource
Cross-accountAssumeRoleService account impersonationFederated identity (OIDC)

A set's definition can bind more broadly than its key. On Google Cloud, sandbox/execute and sandbox/management bind at project scope under either key.

Management access

alien.ts
.permissions({
  profiles: { execution: { credentials: ["vault/data-read"] } },
  management: { extend: { credentials: ["vault/data-write"] } },
})
ValueEffect
"auto" (default)<type>/provision for live resources, <type>/management for frozen ones, plus what enabled features need (heartbeats, telemetry, commands, remote bindings).
{ extend: profile }Adds sets to the derived management permissions.
{ override: profile }Replaces them.

The management identity can't read or write values in your Vaults unless you extend it with vault/data-read or vault/data-write. Grant each only when it must read or write secret values.

Commands add worker/dispatch-command on the target Worker.

alien deploy --automatic-setup gives the management identity broader, stack-wide grants, such as for commands and vault sync.

Limits that always hold

Whatever you grant:

  • The management identity writes to the internal secrets vault, where Alien stores the environment secrets it supplies. On AWS, Google Cloud and Azure it can write values but not read them back. On Kubernetes it keeps read access. It never gets access to the deployer-secrets vault that customers write; an extend or override grant that would reach it fails the build.
  • On AWS, when the stack has a Sandbox with an internet gateway, an explicit Deny stops the management identity from reading the secrets vault, even under automatic setup's broader grants. It protects the sandbox egress signing key.
  • On AWS, the management identity can't change its own role or the roles initial setup creates for sandboxes. The Deny also applies to an override profile.
  • On AWS, every role the management identity creates or changes carries the permissions boundary from initial setup. The management identity can't edit the boundary or remove it.
  • On Azure, initial setup creates every custom role the deployment assigns later, for management and for each profile. The management identity can't create or edit role definitions.
  • On Azure, a condition on the management identity's role assignments admits only the declared roles: management roles onto itself, and application roles onto the deployment's workload identities. It can't assign any other role, such as Owner, or assign to any other identity.

Cloud actions per set

Each set maps to specific cloud actions per platform. For example, storage/data-read includes s3:GetObject, s3:GetObjectVersion, and s3:ListBucket on AWS, and storage.objects.get, storage.objects.list, and storage.buckets.get on Google Cloud. The definitions are in alien-permissions/permission-sets.

Custom permission sets

Pass an inline object where a set name would go:

alien.ts
import * as alien from "@alienplatform/core"

const assumeVendorRole: alien.PermissionSet = {
  id: "assume-vendor-role",
  description: "Assume a role in the vendor account with an external id",
  platforms: {
    aws: [{
      grant: { actions: ["sts:AssumeRole"] },
      binding: {
        stack: {
          resources: ["*"],
          condition: { StringEquals: { "sts:ExternalId": "acme-external-id" } },
        },
      },
    }],
  },
}

export default new alien.Stack("acme")
  .permissions({
    profiles: { execution: { "*": ["storage/data-read", assumeVendorRole] } },
  })
  .build()
FieldNotes
id, descriptionRequired
platforms.aws[]grant.actions, binding.stack or binding.resource with resources, optional condition and notResources, optional effect
platforms.gcp[]grant.permissions or grant.predefinedRoles, binding.stack or binding.resource with scope and optional condition
platforms.azure[]grant.predefinedRoles, grant.actions, or grant.dataActions, binding.stack or binding.resource with scope

A platform without entries gets no grant from that set.

Built-in sets

Sets used in profiles:

ResourceSets
Storagestorage/data-read, storage/data-write (read and write), storage/remote-data-write
Kvkv/data-read, kv/data-write (read and write), kv/remote-data-write
Queuequeue/data-read, queue/data-write, queue/publish (send only), queue/batch-metadata
Vaultvault/data-read, vault/data-write, vault/certificate-management
Postgrespostgres/data-access
Keykey/remote-cryptography, key/native-storage, key/native-volume, key/native-volume-management, key/availability
AIai/invoke
Emailemail/send, email/manage-identities
Sandboxsandbox/management, sandbox/execute, sandbox/remote-execute
Workerworker/execute, worker/invoke, worker/dispatch-command
Buildbuild/execute, build/logs-and-artifacts
ArtifactRegistryartifact-registry/pull, artifact-registry/push (push and pull)
ServiceAccountservice-account/impersonate
ComputeClustercompute-cluster/execute

Sets used by initial setup and the management identity, derived automatically:

PatternCovers
<type>/provisionCreating, updating, and deleting the resource. For every resource type, plus network/provision.
<type>/managementInspecting and reconfiguring an existing resource.
<type>/heartbeatRead-only health checks.
container/volume-backupsLets Amazon Data Lifecycle Manager snapshot and expire this stack's volumes.
storage/trigger-managementAttaching Worker storage triggers to an existing bucket.
postgres/key-recoveryResuming an Aurora cluster after its encryption key is available again.
sandbox/provision, sandbox/templates, sandbox/images, sandbox/protect-setup-rolesSandbox parents, Google Cloud templates, Azure images, and protecting the roles initial setup creates.
email/provision, email/heartbeatSES resources at initial setup, and inbound checks.
remote-stack-management/provision, remote-stack-management/protect-management-roleCreating the cross-account management role, and refusing it changes to its own role.
service-activation/*Enabling Google Cloud project APIs.
azure-resource-group/*, azure-storage-account/*, azure-container-apps-environment/*, azure-service-bus-namespace/heartbeatAzure container resources that other resources depend on.
kubernetes-cluster/heartbeat, kubernetes-public-endpoint/managementManaged Kubernetes metadata, and publishing TLS certificates for public endpoints.
observe/observeAccount-wide read access for discovery and metrics.

Next

On this page