Skip to content

Capability-Based Isolation

Engineer/DeveloperSecurity SpecialistOperations & Strategy

Authored by:

munamwasi
munamwasi
jubos
jubos
masterfung
masterfung

Reviewed by:

matta
matta
The Red Guild | SEAL

Capability-based isolation limits what automation can do by granting specific actions under explicit conditions, instead of broad ambient privileges.

In practice: do not give a job “admin” rights when it only needs “read dependency metadata” or “upload artifact to one path”.

Why this matters in DevSecOps

Many incidents are privilege-shape failures, not code execution failures: compromised workflows succeed because credentials are too broad.

Capability scoping reduces blast radius by ensuring that even successful compromise has constrained impact.

Capability model template

Define capabilities as structured policy units:

FieldExample
Subjectci/workflow/build
Actionartifact.upload
Resourceregistry.example.com/team/app/*
Conditionsbranch is protected, artifact has provenance, session < 15 min
Effectallow / deny

CI/CD capability tiers

Tier 1: Validate

  • read repository
  • execute tests
  • no deploy/publish
  • no production secrets

Tier 2: Build

  • pull dependencies from approved registries
  • upload intermediate artifacts
  • no release signing keys

Tier 3: Release

  • publish signed artifact
  • write release metadata
  • deploy only to approved environment targets

Map these tiers to separate identities/roles rather than toggling permissions in a single long-lived token.

Implementation patterns

  • Use workload identity federation (OIDC) for short-lived credentials.
  • Create role-per-purpose identities (validate/build/release/deploy).
  • Bind capabilities to both identity and runtime context (repo, branch, environment, workflow name).
  • Deny by default; add narrow allow rules.

Audit and revocation requirements

For each capability grant, log:

  • who/what requested it
  • when it was issued and expired
  • what resource/action it enabled
  • whether execution succeeded or was denied

Capability revocation should be immediate and automated for suspicious activity.

Common anti-patterns

  • “One token to rule them all” for all pipeline stages.
  • Reusing static cloud credentials across repositories.
  • Capability definitions without contextual conditions.
  • Missing visibility into denied actions (blind spots hide attacks).

References