Skip to content
s1ns3nz0 | Known Unknowns
Go back

Securing Workflows in CI Pipelines - Secure Pull-Push Operations on Repositories

6 min read

We covered how to secure the build process through the CI pipeline in the previous post. Push and pull operations can be performed by many developers, including external engineers. We’ll now cover how to secure these operations.

Table of contents

Open Table of contents

Two Forms of Checks: Two Forms of Checks

Summary

RequirementGitHub Implementation
Authenticate developers performing pull/push operationsEnterprise SSO + MFA
Ensure a unique identity for each userIndividual GitHub or Enterprise Managed User account
Verify push identityRequire signed commits
Grant pull accessRepository Read permission or higher
Grant push accessRepository Write permission or higher
Ensure requests are consistent with the developer’s roleIdP group → GitHub Team → GitHub Actions role-policy check
Require approval for changes to specific pathsCODEOWNERS
Prevent direct pushes to mainRequire pull requests through a ruleset
Prevent authors from approving their own pull requestsGitHub’s built-in pull request review behavior
Prevent the most recent pusher from providing the final approvalRequire approval of the most recent reviewable push
Invalidate approvals after new commits are pushedDismiss stale pull request approvals
Prevent administrative bypassMinimize and tightly control the ruleset bypass list

REQUIREMENTS

PULL-PUSH_REQ-1

THe project maintainer should run automated checks on all artifacts covered in the change being pushed, such as unit tests, linters, integrity tests, security checks, and more

PULL-PUSH_REQ-2

CI pipelines should only be run using tools when confidence is established in the trustworthiness of the source-code origin of those tools

PULL-PUSH_REQ-3

The repository or source-code management system should either run CI workflows in sandboxed environments without access to the network, any privileged access, or the ability to read secrets or have built-in protection that incorporate a delay in CI workflow runs until they are approved by a maintainer with write access. This built-in protection should go into effect when an outside contributor submits a pull request to a public repository. The setting for this protection should be at the strictest level, such as “Require approval for all outside collaborators”

on:
  pull_requests:

PULL-PUSH_REQ-4

If there are no built-in protections available in the source-code management system, then external security tools with the following features are ruquired


Share this post:

Previous Post
Securing Workflows in CI Pipelines - Integrity of Evidence Generation During Software Updates
Next Post
Securing Workflows in CI Pipelines - Secure Build