Security in CI
Who may read, start, cancel and configure what (IAM), what is audited, and how runs are kept from reaching machines and secrets they should not.
IAM actions
CI is checked per repository: run, log, artifact, environment and repository-variable actions are
evaluated on rn:ews::<organization id>:ci:repository/<repository id>, never on a single run.
Organization-wide things are evaluated on rn:ews::<organization id>:ci:*: listing runs across
repositories, runners, runner groups, runner pools, organization variables, and checking or
converting a workflow file.
| Action | Access | What it allows |
|---|---|---|
ci:ListRuns | Read | List workflow runs for a repository |
ci:GetRun | Read | View a workflow run, its jobs and steps |
ci:GetRunLogs | Read · sensitive | Read workflow run logs |
ci:ListArtifacts | Read | List the artifacts a workflow run produced |
ci:DownloadArtifact | Read · sensitive | Download a build artifact |
ci:DeleteArtifact | Write · destructive | Delete a build artifact before it expires |
ci:CancelRun | Write · destructive | Cancel a workflow run that is still in progress |
ci:RerunWorkflow | Write | Start a new run of a workflow at the same commit |
ci:StartWorkflow | Write | Start a workflow by hand at a branch or tag (workflow_dispatch / on.manual), with inputs |
ci:DescribeRunners | Read | List the self-hosted runners registered to this organization |
ci:ManageRunners | Write · destructive | Issue a runner registration token, and disable a runner |
ci:DescribeRunnerPools | Read | List runner pools, their machines and scaling decisions |
ci:CreateRunnerPool | Write | Create a runner pool: machines started for the jobs its labels match |
ci:UpdateRunnerPool | Write | Change a runner pool's sizes, labels or machine reuse |
ci:DeleteRunnerPool | Write · destructive | Delete a runner pool and its machines (a running job finishes first) |
ci:ListVariables | Read | List configuration variables (vars) of the organization, a repository or an environment |
ci:PutVariable | Write | Create or change a configuration variable |
ci:DeleteVariable | Write · destructive | Delete a configuration variable |
ci:ListEnvironments | Read | List a repository’s deployment environments, their protection rules and pending approvals |
ci:PutEnvironment | Write | Create an environment or change its protection rules (reviewers, wait timer, deployment branches) |
ci:DeleteEnvironment | Write · destructive | Delete an environment, its rules and its variables |
ci:ReviewDeployments | Write | Approve or reject a job waiting at an environment (the environment must also list you as a reviewer) |
ci:CreateIdToken | Write | Issue an OIDC identity token to a running job (recorded for every token) |
Generated from the service’s IAM descriptor. Sensitive reads hand over secret material or source code and are recorded in the audit log like writes; destructive writes delete, overwrite or revoke.
ci:GetRunLogsandci:DownloadArtifactare sensitive: build output can carry anything a step printed. The read-only policies leave them out, and every request is recorded in the audit log, allowed or refused.ci:ManageRunnerson a repository issues registration tokens for that repository only; runner groups, moving and disabling runners need it onci:*.ci:CreateRunnerPoolalso needsautoscaling:CreateLaunchTemplate,autoscaling:CreateAutoScalingGroupandec2:RunInstances.ci:ReviewDeploymentsis not enough to approve a deployment: the environment must list you as a reviewer.ci:CreateIdTokenis granted by no policy. A job'spermissions: id-token: writeand its environment's rules decide; the action names the audit entry of every token issued.- Committing a workflow file is a push:
git:PushRepository.
Audit
Every write through the API that reaches its permission check is recorded in the audit log, allowed
or denied: cancel, re-run, manual start, runner and group changes, pools, variables, environments
and reviews. Every read of logs or an artifact is recorded too, allowed or refused. A request
refused earlier, for
an id that is not valid or a body that does not parse, is not. Every OIDC token issued, and every
refused one, is recorded as ci:CreateIdToken. See Audit log.
What a run can reach
- A run acts as its repository's run identity, which works on that repository only and publishes
only to the registry repositories of its own name (see
What runs on your machines). Its clone token can only read; a
GitHub-syntax job's token can do what the job's
permissions:allow (see Call the GitHub API from a job). - Secrets are judged against the person who started the run. A re-run keeps the original run's person: re-running someone else's run never hands it your secrets. A run that has no such person (an SSH push, a push to a pull request's branch, a pull request reopened by someone other than its author) gets no secrets: when it reads a secret that exists, it fails with "This run has no triggering IAM user, so no policy can be evaluated and secrets are withheld. …".
- A secret reaches a job only when the job names it, the secret is granted to
actionsfor the repository, and the person who started the run may read it. - An environment with reviewers holds its jobs until one approves; on your runners and runner pools such a job reaches no machine before then.
Your own machines
There are no forks: whoever can push a branch decides what that branch's runs execute. A runner in Default takes runs from any repository and any branch, pull requests included.
- Keep deploy or secret-manager credentials only on runners in a group that takes protected branches only.
- Prefer machines that take one job and are retired (
--ephemeralfor GitHub's runner) for runners that take unprotected branches, or runner pools with Fresh machine per job. - The Deutsche Cloud agent on a Mac runs jobs natively, as root, next to your files; the agent's own credential never reaches a step.
- A registration token registers one machine within 15 minutes and is stored only as a hash.
Labels it fixes cannot be widened by the machine, so a machine cannot call itself
deployto be sent deploy jobs. - Disabling a runner revokes its credential at once.