Résumé
ONYEDIKACHI BERNARDCLOUD · DEVSECOPS · AI
RésuméGet in touch
CASE 20BUILD & CI/CD

Environment Segregation for Build Runners

DEV and PROD builds ran on the same GitLab Runner, so a compromised development pipeline could pivot straight into production. I traced the shared runner path across both environments and identified the controls needed to isolate them.

Status: ASSESSED · VERIFIED

DOMAIN
Build & CI/CD
PLATFORM
GitLab CI/CD, GitLab Runner
SEVERITY
High
OUTCOME
Cross-environment path confirmed

TOOLS

GitLabGitLab CI/CDGitLab RunnerGitLab EnvironmentsBashSSHLinux
RESULT
BEFOREShared runner, DEV to PROD
AFTERPivot path documented
01

Objective

I set out to assess whether CI/CD runners were shared across DEV and PROD environments, and whether a compromise in the lower-trust DEV pipeline could provide a path into production infrastructure.

02

Scenario

An organisation maintained separate DEV and PROD environments for their application, each with its own deployment pipeline. I wanted to check whether the build infrastructure was equally separated, or whether a shared component could let an attacker cross from one environment to the other.

03

What I found

runner-configSHARED RUNNER
DEV pipeline runner:     shared-runner-01
PROD pipeline runner:    shared-runner-01
Runner isolation:        None
FINDING 01HIGH

A single runner served both environments

Both the DEV and PROD pipelines were configured to use the same GitLab Runner. There was no runner-level separation between the two environments.

cross-env-accessCROSS ENVIRONMENT
Runner access to DEV host:    Confirmed (SSH)
Runner access to PROD host:   Confirmed (SSH)
Environment separation:       Not enforced at runner level
FINDING 02HIGH

Runner had network access to both environments

The shared runner held SSH credentials and network access to both the DEV and PROD hosts. Compromising the runner through the DEV pipeline provided a direct pivot into the PROD environment.

A compromise in the lower-trust DEV environment could reach production without any additional barrier.

04

What I did

  1. Reviewed the pipeline configuration

    I identified that both DEV and PROD builds used the same GitLab Runner.

  2. Assessed runner access

    The shared runner had SSH access to both the DEV and PROD hosts.

  3. Traced the cross-environment path

    From the DEV pipeline, I confirmed the runner could reach the PROD environment, completing the pivot path.

  4. Documented the exposure

    The shared runner was the single point of failure connecting both environments.

EVIDENCE

TEXT
# Cross-environment access from shared runner
Runner identity:   gitlab-runner (shared across DEV and PROD)
DEV host access:   Confirmed via SSH from runner
PROD host access:  Confirmed via SSH from runner
05

Validation

The lab verification confirmed access to both environments through the shared runner. The cross-environment path was reproducible from the DEV pipeline alone.

06

Before and after

CONTROLBEFOREAFTER
Runner assignmentShared across DEV and PRODExposure documented
Environment separationNot enforced at runner levelRecommended: dedicated runners per environment
SSH credentialsAvailable on shared runnerRecommended: scoped credentials per environment
PROD access from DEVPossible via shared runnerRecommended: network segmentation
Runner isolationNoneRecommended: ephemeral or sandboxed runners
07

What I recommend

  1. 01Assign dedicated runners to each environment so that DEV and PROD builds never share infrastructure.
  2. 02Scope runner credentials to a single environment; the DEV runner should have no way to reach PROD.
  3. 03Use ephemeral runners that are destroyed after each job to limit the window for lateral movement.
  4. 04Apply network segmentation so that build infrastructure for each environment can only reach its own hosts.
  5. 05Monitor runner activity for unexpected SSH connections or cross-environment access patterns.

“A shared CI/CD runner can become a bridge between environments, so DEV and PROD need separate runners, access controls, and security boundaries to prevent a lower-trust compromise from reaching production.”

WHAT I LEARNED

SKILLS IT PROVES

  • CI/CD Security
  • GitLab Security
  • Environment Segmentation
  • Access Control
  • Vulnerability Assessment
  • Security Misconfiguration Analysis
  • GitLab Runner Security
  • Infrastructure Security
  • Credential Management
  • Production Security
View my labs on GitHub