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.
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
| Layer | Who holds it | Comes from |
|---|---|---|
| Provisioning | The customer's admin, once at initial setup | Derived from the stack. Alien never holds it. |
| Management | Alien's management identity, for ongoing management: updates and health checks | Derived from live resources and enabled features. Adjust with management. |
| Runtime | Your workloads | Permission profiles |
Profiles
A profile maps resource ids to permission sets. Workloads pick one with .permissions("<name>").
| Platform | A profile becomes |
|---|---|
| AWS | IAM role |
| Google Cloud | Service account |
| Azure | User-assigned managed identity |
| Kubernetes | Kubernetes ServiceAccount from the Helm chart |
AWS limits apply to each role:
| Limit | Value | Build error when exceeded |
|---|---|---|
| Inline policies per role | 10,240 characters | IAM_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 role | 20 (AWS's default quota) | Generated templates never attach more |
Scopes
profiles: {
execution: {
"*": ["storage/data-read"],
"logs": ["storage/data-write"],
},
}| Key | Scope |
|---|---|
"*" | Every resource of the set's type in the stack's scope |
"<resource id>" | That resource only |
| Aspect | AWS | Google Cloud | Azure |
|---|---|---|---|
| Stack scope | ARN wildcards on the stack's name prefix | Project-level IAM | Resource group |
| Resource scope | The resource's ARN | IAM policy on the resource | Role assignment on the resource |
| Cross-account | AssumeRole | Service account impersonation | Federated 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
.permissions({
profiles: { execution: { credentials: ["vault/data-read"] } },
management: { extend: { credentials: ["vault/data-write"] } },
})| Value | Effect |
|---|---|
"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
secretsvault, 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 thedeployer-secretsvault that customers write; anextendoroverridegrant 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
secretsvault, 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
overrideprofile. - 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:
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()| Field | Notes |
|---|---|
id, description | Required |
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:
| Resource | Sets |
|---|---|
| Storage | storage/data-read, storage/data-write (read and write), storage/remote-data-write |
| Kv | kv/data-read, kv/data-write (read and write), kv/remote-data-write |
| Queue | queue/data-read, queue/data-write, queue/publish (send only), queue/batch-metadata |
| Vault | vault/data-read, vault/data-write, vault/certificate-management |
| Postgres | postgres/data-access |
| Key | key/remote-cryptography, key/native-storage, key/native-volume, key/native-volume-management, key/availability |
| AI | ai/invoke |
email/send, email/manage-identities | |
| Sandbox | sandbox/management, sandbox/execute, sandbox/remote-execute |
| Worker | worker/execute, worker/invoke, worker/dispatch-command |
| Build | build/execute, build/logs-and-artifacts |
| ArtifactRegistry | artifact-registry/pull, artifact-registry/push (push and pull) |
| ServiceAccount | service-account/impersonate |
| ComputeCluster | compute-cluster/execute |
Sets used by initial setup and the management identity, derived automatically:
| Pattern | Covers |
|---|---|
<type>/provision | Creating, updating, and deleting the resource. For every resource type, plus network/provision. |
<type>/management | Inspecting and reconfiguring an existing resource. |
<type>/heartbeat | Read-only health checks. |
container/volume-backups | Lets Amazon Data Lifecycle Manager snapshot and expire this stack's volumes. |
storage/trigger-management | Attaching Worker storage triggers to an existing bucket. |
postgres/key-recovery | Resuming an Aurora cluster after its encryption key is available again. |
sandbox/provision, sandbox/templates, sandbox/images, sandbox/protect-setup-roles | Sandbox parents, Google Cloud templates, Azure images, and protecting the roles initial setup creates. |
email/provision, email/heartbeat | SES resources at initial setup, and inbound checks. |
remote-stack-management/provision, remote-stack-management/protect-management-role | Creating 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/heartbeat | Azure container resources that other resources depend on. |
kubernetes-cluster/heartbeat, kubernetes-public-endpoint/management | Managed Kubernetes metadata, and publishing TLS certificates for public endpoints. |
observe/observe | Account-wide read access for discovery and metrics. |