Security
An extension changes what Alien does for your own deployments, and reaches nothing else. Its hooks and controllers run sandboxed inside Alien, its controllers' cloud calls are made as an identity of their own, and everything it adds to initial setup shows in the setup template.
Architecture diagram. Left: Alien containing Alien manager containing acme controller module. Right: Customer 1's AWS account containing Created at initial setup containing Management role; acme extension role.
What an extension can do
An extension follows the same rules everywhere it runs:
- It changes the setup template, the calls Alien's controllers make, and the resource types your deployments can have.
- It never hides a resource from the setup template.
- It never reaches Alien itself, or another developer's deployments outside the cloud project or account they share. On Google Cloud, give each deployment its own project.
- Everything it runs in Alien or in your customer's environment ships in your release.
- None of its code runs outside Alien's sandbox, except the local controller
alien devstarts on your machine. - In a pull deployment, every cloud call it makes starts inside the customer's environment.
Inside those rules, an extension can hurt your own deployments. An interceptor that changes a response can make Alien believe something false about the cloud, and one that changes an id can point a call at another resource Alien's grants reach. An interceptor can't change a call's operation or the identity it names, can't make storage or a network public, never sees Alien's IAM and policy calls, and on Kubernetes may only add labels. You own its effects, as you own the rest of your release.
Sandbox
Hooks are the modifiers, interceptors, emitters, importers, and links. They build to one WebAssembly module, and Alien runs it inside whichever Alien process needs it:
- No network. A hook can't open a socket or resolve a name.
- No files and no environment. A hook can't read the host's files or environment variables.
- A fresh instance for every call. Nothing carries over from one call, or one deployment, to the next.
- The same output for the same input. Random numbers are seeded and the clock is fixed.
Each call has a time limit, and every hook gets at most 64 MiB of memory and returns at most 16 MiB of output:
| Hook | Time per call |
|---|---|
| Modifiers and emitters | 2 s |
| Interceptors and importers | 100 ms |
A hook over a limit is stopped, and the Alien process keeps running. A failing modifier or emitter stops the template build, and a failing interceptor fails the call, each naming the extension. Alien doesn't retry a hook, since the same input gives the same answer. The one exception is an interceptor's matches or modify_request, which run before the call is sent: the step is tried again when one was stopped at its time limit or its error says another try may pass.
Alien's shared machines run only sandboxed code. An Alien manager you don't host runs your hooks module and your controller module, both in the sandbox.
Where controllers run
A controller is the code that creates and updates a custom resource in the cloud. It builds to a WebAssembly module. Whoever drives the deployment runs the module in a sandbox and signs its cloud calls:
| Who drives | Where the controller runs | Whose credentials sign its calls | In the audit log |
|---|---|---|---|
| The Alien manager, in a push deployment | A sandboxed module in the manager | The extension's identity, short-lived, for each step | The extension's identity |
| The Operator, in a pull deployment | A sandboxed module in the Operator | The extension's identity | The extension's identity |
| The setup CLI, at initial setup | A sandboxed module in the CLI, on the admin's machine | None, so the CLI refuses its cloud calls | No cloud calls |
alien dev | A process on your machine, running the resource's local controller | None | No cloud calls |
The controller sandbox
A controller module runs under the same rules in the manager, the Operator, and the setup CLI:
- No credentials. Alien takes the credentials out of a step before the module reads it. It signs each request after the module hands it over, and blanks the credentials out of the response.
- No sockets, files, or environment. The module reaches nothing but the requests it hands to Alien.
- The cloud's own APIs only. A request names a service and a path, never a host. Alien sends it to that cloud's API endpoints, and follows no redirect. A module can't call a cluster's Kubernetes API, and on Linux servers it can't act on the machine itself.
- Declared origins. The module may also call the origins the extension declares, each
https://host[:port]. Alien sends those requests with none of the deployment's credentials, and only to public addresses. - A fresh instance for every step. Nothing carries over but the state Alien saves.
Alien sets the headers that carry a request's host, credentials, and signature itself, and refuses a request that sets one. It also refuses a query parameter a cloud reads a credential, a signature or the project billed from: any X-Amz-* parameter on AWS, and access_token, oauth_token, key, userProject and any $ parameter on Google Cloud. It also refuses a path that names a Google Cloud project or Azure subscription other than the step's own.
Each step has 60 seconds, 64 MiB of memory, and 50 requests. One Alien process runs at most 64 module steps at a time, at most 16 of one project's, and at most 2 of one deployment's, so one deployment's modules can't hold up another's. Unlike a hook, a step reads the real clock and real random numbers.
The sandbox doesn't limit what the extension's identity may do. A controller can call any API its permission sets allow. Those sets are in the setup template the customer reviews.
Push
The Alien manager runs the module. It mints credentials for the extension's identity for each step, signs the module's requests with them, and never stores them.
Pull
The Operator runs the module inside the customer's environment, so every call starts there. It signs the module's requests as the extension's identity, so the customer's audit log shows them apart from the Operator's own. The module can't read the Operator's credentials.
The setup CLI
When the customer's admin runs initial setup with the setup CLI, the CLI runs the controller module on the admin's machine with no credentials, and refuses its cloud calls. The admin's credentials reach far more than the extension's identity, which is what the customer approves in the setup template.
A stack with a frozen custom resource whose controller calls the cloud is set up from its setup template.
The extension's identity
Initial setup creates an identity for the extension from its permission sets. It is an IAM role on AWS, a service account on Google Cloud, and a managed identity on Azure. Alien signs its controller's calls as that identity after initial setup, and Alien's own calls keep the management identity.
Every permission set has an id under the extension's name, such as acme/dns-zone/provision. The customer's security team sees which extension asks for what.
An extension's provision, management and heartbeat sets go to this identity. The extension declares any grant in them without a change to Alien, and the customer sees every grant in the setup template. Alien refuses a set only when it:
- reads stored customer data, such as an object, a message, a log, a secret's value, an image's layers or a function's code;
- changes IAM or who has access: role and policy writes,
setIamPolicy,Microsoft.Authorizationwrites, bucket, key, queue and repository policies, ACLs, and snapshot sharing; - acts as another identity: assuming or passing a role,
actAs, minting a token or a key, updating a function's code, running a command on a VM, or listing a storage account's or a namespace's keys; - names a predefined Google Cloud or Azure role. List the permissions the set needs instead.
A wildcard that covers one of these is refused too. Workloads get access to data through the sets a custom resource type links to them.
Some ordinary updates are allowed although they can reach further, because refusing them would block managing the resource at all, and no cloud lets a grant leave out the risky part. For example, rds:ModifyDBInstance, rds:ModifyDBCluster, elasticache:ModifyReplicationGroup and redshift:ModifyCluster can set a database's master password or auth token, and Microsoft.App/containerApps/write, Microsoft.App/jobs/write, Microsoft.Web/sites/write and Microsoft.Web/sites/config/write can change the image an app runs with its identity. The customer sees them in the setup template like any other grant.
What your customer reviews
The setup template the customer's security team reviews shows everything an extension adds:
- every resource it adds, and every property it changes on Alien's resources;
- every permission set its custom resources and links grant;
- every origin outside the cloud its controllers may call, listed on the extension's identity;
- every resource Alien emits, since a modifier can't remove one or change its type, and the build fails naming the extension if it tries.
alien render prints the same template with your extensions applied, and lists which extension changed which resource. Use it to preview a package with a reviewer before you release.
Interceptors
An interceptor can change the parameters, body and query (on AWS, only the values of the query's parameters) of a request Alien's controllers send, and the response; on Kubernetes it may only add labels to the object, and never change the response. It can't change where the request goes, which operation it runs or who it acts as, or see what signs it:
- The request still goes to the cloud's own API, so an interceptor can't send it to another host or into Alien's network.
- Its method, path, operation and the identities it names stay as Alien built them, it can't add or change an image in a cloud registry, and no call becomes a policy or IAM call. Alien's IAM and policy calls, and Kubernetes Secrets and service account tokens, never reach an interceptor.
- It can't make storage or a network public. Alien refuses any change to a setting that decides who can reach a resource, such as public access, a network rule, a firewall, a source range, ingress, an ACL or an access policy, and any change that opens a resource to the internet the call didn't open.
- It runs before Alien signs the request, so it never sees the credentials Alien signs with. It does see the bodies of the calls it matches and of their responses, which can carry secrets.
- It runs in the sandbox, with the limits above.
Interceptors covers which calls they see.
Bundles
Your release pins each extension's bundle by digest. Every Alien process that runs a released extension downloads the bundle by its digest, checks its sha256, and caches it. Nothing in the bundle runs before the check passes.
Release and update covers where each bundle is downloaded.
Next
- Controllers: write a controller and see where Alien runs it
- Release and update: bundles, digests, and what
alien releaserefuses - Deployment models: push, pull, and the security review for each