Access Control
Massdriver uses attribute-based access control (ABAC). Permissions match the attributes of projects, environments, components, instances, resources and repositories, not lists of IDs. A new entity with matching attributes is covered by existing policies and grants.
How It Worksβ
- Policies are consumer-side: "members of this group can perform action
Xon entities whose attributes matchC." Conditions match the target of the action. - Grants are publisher-side: "this OCI repo / this resource is visible to recipient projects / environments whose attributes match
C." Conditions match the recipient.
You declare custom attributes at the organization level to establish your attribute structure. Then you author group policies for everyday team RBAC, and grants to make a specific repo or resource visible to other projects / environments.
Custom Attributesβ
Custom attributes define what structural attribute keys exist in your organization, where they are set, and what values are valid. Manage them on the Attributes tab in your org's settings.
Fieldsβ
| Field | Description |
|---|---|
| key | The attribute name (e.g., TEAM, TIER, DOMAIN). Identifier-like β 1-64 chars, letters/digits/underscore, starting with a letter or underscore. Case-insensitive. |
| scope | The level where this attribute is set: project, environment, component, or repo |
| required | Whether the attribute must be provided when an entity is created at that scope. Later updates to that entity do not have to repeat it, and marking an attribute required does not backfill entities that already exist. |
| values | The closed set of valid values for this attribute. Required, non-empty, all unique. You can add a value at any time; removing one is refused while a policy or grant condition would be left matching no value. See Changing Custom Attributes. The literal "*" is reserved for a future "any value accepted" semantic and rejected today. |
Scoping and Cascadeβ
Each attribute key is assigned to exactly one level. If TEAM is scoped to project, only projects can set it. Environments, components, instances, deployments, and resources below that project inherit the value automatically. Lower levels cannot change or override it.
Resource types are OCI repos: they push md-resource-type (a system attribute) onto every resource produced from them, and, like any repo, can carry repo-scoped custom attributes.
Every structural attribute on any entity has a single, unambiguous origin. There is no merge logic and no precedence to debug.
Allowed Valuesβ
The values field constrains what values are valid across the organization. The UI presents a closed dropdown of those values; any value outside the set is rejected at the API.
Two-Layer Validationβ
Allowed values define what is valid for the entire organization. Policy conditions further narrow what a specific user can set.
- Custom attribute β the org admin says "
DOMAINcan be one of: payments, identity, platform, network" - Policy condition β a group policy says "members of this group can create projects where
DOMAINis payments"
The user sees the intersection. A payments engineer creating a project sees DOMAIN as a required dropdown with one option. An org admin sees all values.
Exampleβ
Custom attribute:
key: DOMAIN
scope: project
required: true
values: [payments, identity, platform, network]
Group: payments-eng
policy: project:create where DOMAIN: [payments]
Group: platform-eng
policy: project:create where DOMAIN: [platform, network]
- A
payments-engmember sees the DOMAIN dropdown with one option:payments - A
platform-engmember sees two options:platform,network - An org admin sees all four
Only Declared Attributes Are Acceptedβ
Massdriver rejects an attribute key that has no custom attribute declared for that scope.
Reserved Prefixβ
Attribute keys starting with md- are reserved for system attributes. Users cannot create custom attributes or set attribute values with this prefix.
System Attributesβ
Massdriver automatically injects system attributes on every entity. These use the reserved md- prefix, cascade through the resource hierarchy, and cannot be set or overridden by users.
Resource Hierarchyβ
An instance is the intersection of an environment and a component. Deployments and resources carry the attributes of their instance with their own md-id. A resource also gets md-resource-type from its resource type, which contributes nothing else today. A resource at the bottom carries the attributes of every parent above its instance.
Attribute Referenceβ
| Attribute | Set at | Example | Cascades to |
|---|---|---|---|
md-id | every entity | api, api-prod, api-prod-database.primary | nowhere β always the entity's own identity |
md-project | project | api | environment, component, instance, deployment, resource |
md-environment | environment | prod | instance, deployment, resource |
md-component | component | database | instance, deployment, resource |
md-repo | component | aws-aurora | instance, deployment, resource |
md-repo-artifact-type | repo | resource-type | nowhere β repo only |
md-instance | instance | api-prod-database | deployment, resource |
md-bundle | instance | aws-aurora@1.2.3 | deployment, resource |
md-resource-type | resource type | aws-iam-role@0.0.0 | resource (every resource produced from this type) |
md-repo-artifact-type is the repo's kind: bundle or resource-type. It lets a policy target one kind of repo β for example, repo:view where md-repo-artifact-type: [resource-type]. It is set on the repo and does not cascade.
md-bundle and md-resource-type are version-qualified (name@version): a condition value containing @ pins exactly one version; a bare name matches every version of that name.
md-id is always the entity's own identifier, never inherited:
- Project, environment, component, instance: the dotted slug (
api,api-prod,api-prod-database) - Deployment: the deployment's UUID
- Provisioned resource:
{instance}.{field}(e.g.,api-prod-database.primary) - Imported resource: the resource's UUID
Use md-instance to target everything produced by a specific instance β the instance itself, every deployment of it, and every resource it has produced.
Resolutionβ
Effective attributes resolve through the parent chain at evaluation time. Renaming a project, moving an instance between environments, or changing a custom attribute value propagates immediately to every deployment and resource downstream. Audit history of "what was true at deploy time" lives in audit logs.
Imported resources have no parent instance and live at the org level. They carry only md-id (their UUID), md-resource-type (from the resource type), and any user attributes set directly on the row. They do not inherit md-project / md-environment / md-component / md-instance β there's no parent chain.
System attributes combine with your custom attributes for fine-grained targeting. A provisioned resource at the bottom of the hierarchy carries attributes from every level above it.
Example: Full Attribute Set on a Resourceβ
For a resource produced by the database component in the prod environment of the api project, deployed using aws-aurora@1.2.3, with custom attribute TEAM: payments:
TEAM: payments β custom attribute, set on project, cascaded down
md-project: api β from project
md-environment: prod β from environment
md-component: database β from component
md-instance: api-prod-database β from instance (cascades to deployments + resources)
md-repo: aws-aurora β from instance (repo name)
md-bundle: aws-aurora@1.2.3 β from instance (repo + version)
md-resource-type: aws-aurora-cluster@1.0.0 β from resource type
md-id: api-prod-database.primary β this resource's identity
Identifiers as Governance Leversβ
md-project, md-environment, and md-component carry the local identifier chosen at create time β the short name like api, prod, or database, not the full hierarchical form. Local identifiers are constrained to [a-z0-9]{1,20} and are immutable after creation.
Policy conditions on these attributes are evaluated at create time against the proposed entity, which turns naming conventions into enforceable contracts:
group: app-eng
policies:
- effect: allow
action: environment:create
conditions: { md-environment: [dev, staging, prod] }
A member of app-eng cannot create an environment named stage, qa, or anything outside the allowed set β the mutation returns forbidden before the row is written. The same lever applies to projects and components via md-project and md-component.
Creation gating, list filtering, deny rules and UI dropdowns all apply to these conditions.
Policiesβ
A policy grants or denies a principal the ability to perform an action on entities matching attribute conditions.
Structureβ
| Field | Description |
|---|---|
| effect | allow or deny |
| action | The operation being granted or denied (e.g., instance:deploy) |
| conditions | Attribute key/value pairs the entity must match, or * for any entity of that type |
The action determines what kind of entity the policy applies to β project:view applies to projects, instance:deploy applies to instances.
Principalsβ
Policies are attached to groups. Group membership determines who the policy applies to; the policy's action and conditions determine what they can do and against which entities. Manage groups, policies, and members on the Groups tab in your org's settings.
New organizations start with these custom groups. They have no members. You can rename them, delete them, or change their policies.
| Group | Policies |
|---|---|
| Organization Viewers | Allow project:view, stash:view, repo:view, resource:view |
| Developers | Allow project:view, project:design, environment:create, environment:update, environment:configure, instance:configure, instance:plan, instance:propose, repo:view, repo:pull, resource:view, stash:view, stash:write, stash:export |
| Production Deployers | Allow project:view, stash:view, resource:view. Allow instance:plan, instance:deploy, environment:deploy where md-environment is prod or production |
| Platform Engineers | Allow repo:view, repo:pull, repo:push, repo:create, repo:update, repo:grant, repo:delete, organization:manageResourceTypes, organization:manageCustomAttributes, project:view, resource:view, resource:import, resource:update, resource:grant, stash:view |
| CI / Automation | Allow project:view, repo:view, repo:pull, repo:push, instance:configure, instance:plan, instance:deploy, stash:view, stash:write, stash:export |
| Billing | Allow organization:manageBilling |
Developers propose deployments, and Production Deployers approve them in production. To let Developers deploy to other environments, add an allow policy for instance:deploy with an md-environment condition, for example ["dev", "staging"].
For per-repo or per-resource sharing β making a specific OCI repo or resource visible to other projects / environments β see Grants below.
Evaluation Rulesβ
- Within a single policy, every reachable attribute condition is AND β every condition whose attribute scope can plausibly appear on the action's entity must match. See Conditions and Action Reach for what "reachable" means for each action.
- Across policies, evaluation is OR β any single fully-matching policy is sufficient
- Partial matches never accumulate β you cannot combine conditions from different policies
- Deny wins β if any deny policy matches, access is denied regardless of allow policies
- Implicit deny β if no policy matches, access is denied
- Built-in admin group has full access β the built-in
organization.admingroup grants its members every action in the org. You cannot add policies to it, rename it, or delete it. organization:manageis a one-level umbrella β a policy whoseactionsincludesorganization:managesatisfies anyorganization:manage*sub-action query. Author it once on a custom group to grant full org-level administrative access without putting people in the built-in admin group. The umbrella does not widen any other namespace, and holding a single sub-action does not imply the umbrella.- Empty conditions are invalid β use
*for wildcard
Multi-Action Policies and Scope Filteringβ
A single policy can list actions across different entities:
- effect: allow
action: [project:create, instance:configure]
conditions:
team: [eng] # registered scope: project
soc2: ["true"] # registered scope: component
The same conditions map applies to every listed action, but each condition is evaluated only on the actions whose entity can carry the attribute via the cascade tree:
project:createevaluates with{team: [eng]}(soc2 is component-scoped β projects sit above components in the tree and don't inherit from them β it's dropped).instance:configureevaluates with{team: [eng], soc2: ["true"]}(instances inheritteamfrom the project cascade andsoc2from their component).
When a policy's conditions filter to empty for a given action, the policy is a wildcard match for that action only. Authoring tip: if you want different gating per action, write multiple policies β every condition you list intends to gate every action it's reachable for.
Condition Matchingβ
Each condition value is either "*" (per-key wildcard β match any value for
that key) or a non-empty list of strings (closed set):
TEAM: ["payments"]β the entity'sTEAMattribute must bepaymentsmd-environment: [dev, staging]β the entity'smd-environmentmust bedevorstagingmd-project: "*"β match any value formd-project(per-key wildcard)*(whole-field) β match any entity of that type, regardless of attributes
What You Can Targetβ
Using system attributes and custom attributes together:
- All resources in a project:
md-project: [api] - All production resources:
md-environment: [prod] - All database components:
md-component: [database] - Everything produced by a specific instance:
md-instance: [api-prod-database] - Any version of a bundle:
md-repo: [aws-aurora] - A specific bundle release:
md-bundle: [aws-aurora@1.2.3] - A specific entity:
md-id: [api-prod-database.primary] - Resources by type:
md-resource-type: [aws-iam-role] - Your team's non-prod instances:
TEAM: [payments], md-environment: [dev, staging] - Any project's prod environment:
md-project: "*", md-environment: [prod]
Conditions and Action Reachβ
The attributes reachable for each action's entity. A condition on an attribute that is not in the action's row is dropped when that action is evaluated. If all conditions drop, the policy is a wildcard for that action.
Prefer system attributes such as md-environment: [prod] over md-id wildcards such as md-id: [api-prod-*].
| Action's entity | Reachable system attributes | Reachable custom attribute scopes |
|---|---|---|
| project | md-id, md-project | :project |
| environment | md-id, md-project, md-environment | :project, :environment |
| component | md-id, md-project, md-component, md-repo | :project, :component |
| instance | md-id, md-project, md-environment, md-component, md-repo, md-instance, md-bundle | :project, :environment, :component |
| resource | md-id, md-project, md-environment, md-component, md-repo, md-instance, md-bundle, md-resource-type | :project, :environment, :component |
| repo | md-id, md-repo | :repo |
| resource_type | md-id | (none today) |
| stash | The row of the entity that holds the entries: project, environment, component, or instance | The row of that entity |
Cascade: a custom attribute registered at scope :project is reachable on every descendant β environment, component, instance, resource β because the project's value flows down. Setting team: payments at the project level means every instance in that project carries team=payments for policy matching, even though the value isn't physically stored on each instance row.
Examples:
[project:create]withconditions: {md-environment: [prod]}βmd-environmentisn't reachable for:project, drops, policy is a wildcard. Themd-environmentfilter is meaningless here; rewrite the policy.[instance:deploy]withconditions: {team: [eng]}βteam(at project scope) cascades to instances. The instance's effectiveteam(inherited from its project) must equaleng.[project:view, instance:deploy]withconditions: {soc2: ["true"]}(component scope) βproject:viewbecomes a wildcard (soc2drops);instance:deployrequires the instance's component to be taggedsoc2=true.
Permissionsβ
Massdriver defines 44 permissions in entity:verb format.
Projectβ
project:view is the read gate for all infrastructure. If you can view a project, you can see its environments, instances, and deployments.
| Permission | Description |
|---|---|
project:view | View a project and all its children |
project:create | Create a project |
project:update | Update project name, description, and attributes |
project:delete | Delete a project |
project:design | Modify the project blueprint β add/remove components, create/delete links |
Environmentβ
| Permission | Description |
|---|---|
environment:create | Create an environment in a project |
environment:update | Update environment name, description, and attributes |
environment:delete | Delete an empty environment β instances must be decommissioned first |
environment:configure | Set or remove environment-level resource defaults |
environment:deploy | Deploy every instance in an environment, in dependency order. Re-triggering an in-flight environment deployment cancels and replaces the prior run. |
environment:decommission | Decommission every instance in an environment, in reverse dependency order. The environment shell is kept so it can be redeployed. |
Instanceβ
| Permission | Description |
|---|---|
instance:configure | Set parameters, secrets, version, and remote references |
instance:deploy | Deploy infrastructure. Also approves or rejects proposed deployments β anyone who can deploy an instance can decide a proposal for it. |
instance:plan | Run an infrastructure plan without deploying |
instance:decommission | Tear down infrastructure |
instance:propose | Submit a deployment for approval, including a rollback proposal that returns the instance to a past deployment's exact state. Approving or rejecting the proposal is gated by instance:deploy β anyone who can deploy can also decide a proposal. |
instance:move | Move an instance, with its configuration, state, and deployment history, to an environment in another project. Checked on the instance before and after the move. The move also needs every permission for what it creates: project:design to add the component, instance:configure and resource:view for each remote reference, and resource:grant for each grant. |
Repoβ
| Permission | Description |
|---|---|
repo:view | View a repository in the catalog and UI β bundle repos and resource-type repos alike |
repo:pull | Download a repo's contents β a bundle's files, or a resource type a bundle references |
repo:push | Publish a new version β bundle or resource type |
repo:create | Create a new (empty) OCI repository |
repo:update | Modify a repository's user-settable metadata (e.g. attributes) |
repo:grant | Author or revoke grants sharing this repo with recipient projects. Distinct from repo:update (metadata) and repo:pull (downloading bundle contents). |
repo:delete | Remove an OCI repository (only when no versions are published) |
Resourceβ
| Permission | Description |
|---|---|
resource:view | View resource metadata and listings |
resource:export | Download credential payloads β IAM roles, connection strings, certificates |
resource:import | Import external cloud resources into Massdriver |
resource:update | Update an imported resource |
resource:grant | Author or revoke grants sharing this resource with recipient environments. Distinct from resource:update (metadata) and resource:export (downloading the unmasked payload). |
resource:delete | Delete a resource |
Resource Typeβ
A resource type is an OCI repo, governed by the same repo:* permissions as a bundle repo. There is no separate resource_type:* action set β the repo permissions cover it, and the version rides in the type's identity, so there is no per-version permission.
Seeing a type β repo:view. repo:view on the type's repo controls whether you see the type in the catalog and UI. The default is admin-only: org owners and admins see every type, and other members opt in with a repo:view policy β for example, repo:view where md-repo-artifact-type: [resource-type] grants view of resource-type repos. This governs the type only; seeing a resource of that type still needs a resource permission (resource:view, the project cascade, or a grant).
Referencing a type from a bundle β vetted at publish, inherited by consumers. When a bundle declares a dependency or resource of a given type, the access check is on the bundle's publisher, not its consumers. Publishing a bundle verifies the publisher holds repo:pull on every resource type the bundle references; a publish that references a type the publisher cannot pull is rejected and names it (for example, no access to postgres-connection@1.2.3). The check runs once, at publish. After the bundle is published, the referenced types travel with it: anyone who can use the bundle can use those types, with no repo:view or repo:pull of their own. The canvas, links, and deployments resolve each type through the reference stored in the bundle; a consumer is never checked against a resource type directly.
Publishing a type β repo:push. Publishing a version of a type is repo:push on its repo (the OCI publish path); repo:create makes the repo the first time. The transitional GraphQL publishResourceType / deleteResourceType mutations are gated by organization:manageResourceTypes and retire with the v1 CLI.
Targeting resources by type β md-resource-type. Resource types push md-resource-type onto every resource produced from them, as name@version (e.g. aws-iam-role@0.0.0). Policies target by type with a bare name β md-resource-type: [aws-iam-role] matches every version β or pin a version with md-resource-type: [aws-iam-role@0.0.0].
Resource-type repos are not shared through grants β grants are a bundleβproject mechanism. A resource type's reach is repo:view (who sees it) and repo:pull (who can reference it from a bundle).
Stashβ
A stash holds key and value entries on a project, environment, component, or instance. The entries of a deployment belong to its instance. Massdriver checks each stash action against the entity that holds the entries. So a condition such as md-environment: [prod], or a custom attribute, applies to the stashes of the entities that match.
project:view does not include stash:view. Grant it on its own.
| Permission | Description |
|---|---|
stash:view | Read stash entries, without sensitive values, and subscribe to their changes. Notes and widgets need it to show stash values. |
stash:write | Set and delete stash entries |
stash:export | Read sensitive stash values |
A deployment's own credentials do not use these permissions. A deployment can read and write the stashes of its deployment, instance, environment, component, and project. It can also read, but not change, the stash of each instance whose resources its instance uses as dependencies. It cannot read the sensitive values in those stashes.
Organizationβ
Organization permissions are one umbrella action and ten sub-actions. A policy with organization:manage covers every sub-action. A policy with a sub-action grants only that capability.
| Permission | Description |
|---|---|
organization:manage | Umbrella. A policy granting organization:manage satisfies any of the ten organization:manage* sub-actions below. |
organization:manageServiceAccounts | Create, update, delete, list, and inspect service accounts. |
organization:manageGroups | Create, update, and delete groups, manage their members and invitations, and author group policies. |
organization:manageBilling | View and change subscription, payment, seats, and Stripe customer portal. |
organization:manageIntegrations | Configure, enable, disable, and delete third-party integrations (cost reports, metrics, etc.). |
organization:manageCustomAttributes | Declare, update, and delete custom attributes β the org-wide schema that governs user-defined attributes on projects, environments, components, and resources. |
organization:manageResourceTypes | Publish and delete resource types β the org-level catalog of schemas describing each kind of infrastructure output. |
organization:manageSettings | View and change organization-wide behavior settings, such as the default access granted to new bundle repositories. |
organization:manageProfile | Update display name and logo. |
organization:manageMembers | Remove members from the organization, which also revokes their group memberships, invitations, and access tokens. |
organization:manageEventDestinations | Add, change, pause, resume, and delete the destinations that receive the organization's events, see what each destination was sent, and send failed events again. |
Reading the organization's public profile (name, logo, identifier) is open to every org member β no policy required.
Common Patternsβ
Product Team with Non-Prod Accessβ
The team can view their projects, design architecture, configure and deploy to dev and staging, and propose production deployments β but cannot approve them.
group: payments-eng
policies:
- effect: allow
action: [project:view, project:update, project:design]
conditions: { TEAM: [payments] }
- effect: allow
action: [environment:create, environment:update, environment:configure]
conditions: { TEAM: [payments], md-environment: [dev, staging] }
- effect: allow
action: [instance:configure, instance:deploy, instance:plan]
conditions: { TEAM: [payments], md-environment: [dev, staging] }
- effect: allow
action: instance:propose
conditions: { TEAM: [payments], md-environment: [production] }
SRE with Cross-Cutting Production Accessβ
SRE can see all projects and deploy, decommission, propose rollbacks, or approve proposed deployments anywhere in production. instance:deploy covers both running a deployment and deciding a proposal β including rollback proposals β submitted by another team. instance:propose lets SRE author rollback proposals themselves when paging through an incident.
group: sre
policies:
- effect: allow
action: project:view
conditions: "*"
- effect: allow
action: [instance:deploy, instance:decommission, instance:propose]
conditions: { md-environment: [production] }
- effect: allow
action: [environment:deploy, environment:decommission]
conditions: { md-environment: [production] }
Read-Only Auditorβ
Full visibility, no write access.
group: auditors
policies:
- effect: allow
action: [project:view, repo:view, resource:view]
conditions: "*"
Compliance Auditor on PCI Projectsβ
Auditors can view and design any project flagged pci: true, and the
audit-tooling bundle is the only one visible to them on those projects.
custom_attribute:
key: pci
scope: project
required: false
values: ["true", "false"]
group: compliance-auditors
policies:
- effect: allow
action: [project:view, project:design]
conditions: { pci: ["true"] }
Bundle visibility is gated on the publisher side. A grant on the
audit-tooling repo makes it pullable by recipients whose project
matches pci: true:
# On the audit-tooling repo
grant:
source: { repo: audit-tooling }
action: repo:pull
recipient_conditions: { pci: ["true"] }
The two layers compose: project:design lets the auditor touch the
canvas of any PCI project, and repo:pull controls which bundles
they can see and attach. To restrict them to only the audit bundle,
don't grant any other repo:view/repo:pull policies β the bundle
picker will only show what they have access to.
Grantsβ
Grants are how a publisher (the team that owns an OCI repo or a resource) makes their thing visible to other projects or environments. Policies say "members of my group can pull repos that match these attributes." Grants say "this specific repo of mine is visible to projects that match these attributes."
A grant is the inverse direction of a policy: the conditions match the recipient project / environment, not the entity being acted on.
For step-by-step instructions, see Share Bundles with Projects and Share Resources with Environments.
Structureβ
| Field | Description |
|---|---|
| source | Exactly one of source_repo_id (an OCI repo) or source_resource_id (a resource). The thing being shared. Repo grants share bundle repos; resource-type repos are governed by repo:view/repo:pull, not grants. |
| action | The action being granted on the source β e.g., repo:pull, resource:export. The action's entity must match the source kind. |
| recipient_conditions | Either the explicit wildcard "*" (every recipient in the org) or attribute conditions the recipient project / environment must satisfy. Same shape as policy conditions; required on create. |
A single grant fans out to every project or environment that satisfies its recipient conditions. There is no recipient FK β recipients are matched at access-evaluation time. When a new project is created with attributes matching an existing grant, it picks up that visibility automatically.
How visibility composesβ
Group repo:view and resource:view policies decide what shows up in lists
and metadata reads β "this group can see bundles / resources whose attributes
match." Grants decide what a project or environment can actually use β
"this specific bundle is usable by projects that match these attributes;
this specific resource is usable by environments that match these
attributes."
A caller's visible bundles is the union of:
- bundles their groups have a
repo:view(or higher) policy on, plus - bundles with a grant whose
recipient_conditionsmatch a project the caller hasproject:viewon.
A grant adds to what a caller sees beyond their own policies. If a bundle is
granted to any project the caller can view, the caller sees the bundle in the
catalog, even when no repo:view policy matches it. A deny repo:view policy
removes bundles from the policy side only, so it does not hide a granted
bundle. To keep a bundle out of a group's view, narrow the grant's
recipient_conditions, or delete the grant.
Users of a bundle need its repo page to read the changelog and to see the instances and deployments that use the bundle. The repo page is how a user tracks a bundle across their projects.
Inside a project, the canvas lists only the bundles granted to that project.
These are the bundles that can be added to it. The My bundles list shows
the bundles your own repo:view policies match. You cannot add them from
there. Grant a bundle to the project from its Permissions page first.
The ociRepos query has two filters that split the list:
filter.projectIdreturns only the bundles granted to that project. You must haveproject:viewon the project, or the query returnsNOT_FOUND.filter.viewer: truereturns only the repos your ownrepo:viewpolicies match.falsereturns only the repos you see through a grant. When omitted, both are returned.
When both filters are set, a repo must match both. To list a project's bundles and your own bundles together, make two queries.
Example: you can view projects checkout and billing, and your group policy
allows repo:view on repos with TEAM=payments.
| Repo | TEAM | Granted to |
|---|---|---|
aws-aurora | payments | none |
aws-s3 | payments | checkout |
aws-iam-role | none | checkout |
aws-vpc | none | billing |
filter | Result |
|---|---|
| none | aws-aurora, aws-iam-role, aws-s3, aws-vpc |
{ projectId: "checkout" } | aws-iam-role, aws-s3 |
{ projectId: "billing" } | aws-vpc |
{ viewer: true } | aws-aurora, aws-s3 |
{ viewer: false } | aws-iam-role, aws-vpc |
{ projectId: "checkout", viewer: true } | aws-s3 |
{ projectId: "checkout", viewer: false } | aws-iam-role |
{ projectId: "billing", viewer: true } | empty list |
{ projectId: "x" }, no project:view on x | NOT_FOUND error |
query {
ociRepos(organizationId: "acme", filter: { projectId: "checkout" }) {
items {
name
}
}
}
A caller's visible resources is the union of:
- the project cascade β provisioned resources whose parent project the
caller has
project:viewon, plus - resources their groups have a
resource:viewpolicy on, plus - resources with a grant whose
recipient_conditionsmatch an environment the caller can see (envs are visible via their parent project'sproject:view).
Members of the built-in admin group see every resource.
Recipient matchingβ
Grants target different recipient kinds depending on the source:
| Source kind | Recipient kind | Match against |
|---|---|---|
| Repo | Project | the recipient project's effective attributes (user attrs + md-project + md-id) |
| Resource | Environment | the recipient env's effective attributes (env user attrs + project cascade + md-environment + md-project + md-id) |
Matching uses the same condition semantics as group policies:
AND-within-conditions, per-key "*" requires the attribute to be present,
list values are any-of. A grant with recipient_conditions = nil is the
org-wide wildcard.
Because env effective attributes inherit cascaded project attributes, you
can write a resource grant against a project-scoped attribute like
md-project, TEAM, or pci and it will match envs in projects that
satisfy the condition.
Use vs. viewβ
- View is gated by group
repo:view/resource:viewpolicies. - Use is gated by a grant covering the destination project or environment, in addition to the caller's view permission:
| Action | View check | Grant check |
|---|---|---|
addComponent (project blueprint) | repo:view on the bundle | a repo grant covering the destination project |
setRemoteReference (instance) | resource:view on the resource | a resource grant covering the instance's environment |
setEnvironmentDefault | resource:view on the resource | a resource grant covering the destination environment |
Seeing a bundle in the catalog or a resource in the resources list is not the same as the destination being permitted to consume it. Both gates apply at the consumption mutation. Admins pass the view check, but the grant check has no admin exception: even an admin must create a grant before using an ungranted bundle or resource in a project or environment.
Examplesβ
Share the aws-aurora-postgres repo with any project tagged TEAM=payments:
source: { repo: aws-aurora-postgres }
action: repo:pull
recipient_conditions: { TEAM: [payments] }
Share a managed-database resource with prod and staging environments:
source: { resource: payments-prod-postgres-primary }
action: resource:export
recipient_conditions: { md-environment: [prod, staging] }
Share a managed-database resource with every environment in PCI projects:
source: { resource: payments-prod-postgres-primary }
action: resource:export
recipient_conditions: { pci: ["true"] }
Open a repo to the entire org (wildcard) β every project sees it:
source: { repo: shared-vpc-template }
action: repo:pull
recipient_conditions: "*"
Authoring grantsβ
Grant mutations are gated by edit access on the source:
| Mutation | Authorization |
|---|---|
createRepoGrant | repo:grant on the source repo |
createResourceGrant | resource:grant on the source resource |
deleteGrant | repo:grant (repo-source grant) or resource:grant (resource-source grant) |
Grants are immutable: to change recipient_conditions or action, delete and
re-create. There is no updateGrant.
Policy Patternsβ
Custom attributes and policy conditions can also encode platform conventions: naming, ownership, lifecycle, capability gating, and specialist authority.
Enforcing Naming Conventionsβ
Use case: developers can only create environments named dev, staging, or prod.
Because md-environment is the slug of the environment, constraining it on environment:create constrains what slugs are creatable.
group: developers
policies:
- effect: allow
action: environment:create
conditions: { md-environment: [dev, staging, prod] }
A user in this group sees the closed set in the UI and gets a rejection at the API for anything else.
The same pattern applies to any system attribute that doubles as an identifier: md-project for project names, md-component for component names, and md-repo for OCI repo names.
Stacking Group Permissions for Specialized Teamsβ
Use case: the base developers group can create dev / staging / prod. The AI team needs an extra model-build environment β but only on projects their team owns.
Two pieces compose this. First, declare a project-scope attribute for architectural ownership:
Custom attribute:
key: ARCHITECTURE_TEAM
scope: project
required: true
values: [payments, checkout, ai, platform]
Then two groups, each contributing its own slice:
group: developers
policies:
- effect: allow
action: environment:create
conditions: { md-environment: [dev, staging, prod] }
group: ai-team
policies:
- effect: allow
action: environment:create
conditions:
md-environment: [model-build]
ARCHITECTURE_TEAM: ai
A user in both groups gets the union of their slices: dev / staging / prod on any project, and model-build only on AI-owned projects. AND-within-policy, OR-across-policies does the work β the model-build allow doesn't bleed onto a payments project because the ARCHITECTURE_TEAM: ai condition won't match there.
This is the general shape of capability extension: a base group establishes the default surface area, and specialty groups add narrow, attribute-conditioned extensions on top.
Template Projectsβ
Use case: some projects are templates β reference architectures meant to be cloned, not deployed. They should have a single environment named template and no real lifecycles.
Declare a project-scope attribute that marks templates:
Custom attribute:
key: PROJECT_KIND
scope: project
required: true
values: [standard, template]
Split environment:create by project kind:
group: developers
policies:
# Standard projects get the normal lifecycle
- effect: allow
action: environment:create
conditions:
PROJECT_KIND: standard
md-environment: [dev, staging, prod]
# Template projects get exactly one environment, named "template"
- effect: allow
action: environment:create
conditions:
PROJECT_KIND: template
md-environment: [template]
The project's PROJECT_KIND decides which environments can be created in it. Other project-shape decisions (sandbox or production, internal or customer-facing, regulated or unregulated) work the same way.
Naming Ownership by Roleβ
Use case: a project has an architecture team that designed it and a development team that builds against it. An environment has an SRE team that operates it and a security team that audits it. A component has a maintenance team. Each role needs different access, which a single TEAM attribute cannot express.
Declare one attribute per role, at the scope where the responsibility lives:
Custom attribute:
key: ARCHITECTURE_TEAM # who designed and architecturally owns the project
scope: project
required: true
values: [payments, checkout, ai, platform]
Custom attribute:
key: DEVELOPMENT_TEAM # who writes code against this project
scope: project
required: true
values: [payments, checkout, ai, platform, mobile]
Custom attribute:
key: SRE_TEAM # who operates this environment
scope: environment
required: false
values: [koalas, otters, pandas]
Custom attribute:
key: SECURITY_TEAM # who audits this environment
scope: environment
required: false
values: [appsec, infrasec, compliance]
Custom attribute:
key: MAINTENANCE_TEAM # who keeps this component healthy
scope: component
required: false
values: [koalas, otters, pandas, dba, netops]
Project-scope attributes cascade to environments, components, instances, deployments and resources. Environment-scope and component-scope attributes cascade to instances, deployments and resources. A resource carries every role attribute set above it, and policies can match any combination.
Each group keys off the role that matches its responsibility:
group: koalas-sre
policies:
- effect: allow
action: project:view
conditions: "*"
- effect: allow
action: [instance:deploy, instance:decommission]
conditions: { SRE_TEAM: koalas }
group: appsec
policies:
- effect: allow
action: project:view
conditions: "*"
- effect: allow
action: [resource:view, resource:export]
conditions: { SECURITY_TEAM: appsec }
The two policies cover different actions and conditions and do not interact.
Handing off a team's responsibility is one attribute change. To move operation of prod from koalas to otters, set SRE_TEAM: otters on that environment.
Cross-Cutting Specialist Teamsβ
Use case: a DBA team manages every database and storage component in the org, in any project or environment.
Components can carry a PURPOSE attribute classifying what they do:
Custom attribute:
key: PURPOSE
scope: component
required: true
values: [api, web, worker, database, storage, network, cache, queue]
A specialist group then keys off purpose rather than ownership:
group: dba
policies:
- effect: allow
action: project:view
conditions: "*"
- effect: allow
action: [instance:configure, instance:deploy, instance:plan, resource:update]
conditions: { PURPOSE: [database, storage] }
The DBA team can configure, deploy, and decide proposed deployments for any database or storage component. instance:deploy covers both running a deployment and approving or rejecting a proposal. A new project's database components tagged PURPOSE: database are covered without changes.
The same shape extends to other specialist functions:
- A network team keying off
PURPOSE: [network, cache] - A platform security group keying off
md-resource-type: aws-iam-rolefor blast-radius review - A cost engineering team keying off
PURPOSE: [database, storage, queue]for high-spend capacity tuning - An ML platform team keying off
PURPOSE: [model-serving, training]
Capability Gating by Tierβ
Use case: only projects with a high SLA can create a load-test environment.
Conditions match exact values, not numeric ranges, so "above 99.9%" is a set of qualifying values or a derived flag.
Option A β Enum the SLA tier directlyβ
Custom attribute:
key: SLA_TIER
scope: project
required: true
values: ["99", "99.9", "99.95", "99.99"]
group: developers
policies:
- effect: allow
action: environment:create
conditions: { md-environment: [dev, staging, prod] }
- effect: allow
action: environment:create
conditions:
SLA_TIER: ["99.95", "99.99"]
md-environment: [load-test]
Use this when the SLA tier is also used elsewhere, such as for reporting, alert thresholds, or cost allocation.
Option B β Derive a HIGH_SLA flagβ
Custom attribute:
key: HIGH_SLA
scope: project
required: true
values: ["true", "false"]
group: developers
policies:
- effect: allow
action: environment:create
conditions:
HIGH_SLA: ["true"]
md-environment: [load-test]
The same pattern gates other capabilities, such as a compliance scanner for regulated workloads or a region-bound feature for projects in one region.
Day-2 Operationsβ
Permissions match attributes, not IDs, so they survive the lifecycle of your infrastructure:
- Deleting and recreating a database does not revoke the ability to manage it.
- During a migration, the old and new resources carry the same attributes.
Built-in Administrationβ
The built-in organization.admin group has full access to everything in the org. You cannot add policies to it, rename it, or delete it. Use custom groups for everything else, and keep admin membership small.
Relatedβ
- ABAC by Example β three organizations modeled end to end, with policies, grants, and traced access decisions
- GraphQL permissions reference β the permission required by every GraphQL operation
- Service Accounts β non-human principals that authenticate to the API
- Share Bundles with Projects and Share Resources with Environments β step-by-step grant guides