Non-Fiction, Annual Checkup, DevSecOps

DevOps Security Shift Left eBook

Review CI/CD pipeline compromise and infrastructur

by Whaley Destiny

  • English
  • 145 pages
  • 2026
  • SamEnrico

Review CI/CD pipeline compromise and infrastructure as code risks.

Formats

Free sample

Chapter 1: The Last Safe Assumption...--The first time Maya Chen saw a pipeline compromise, she almost missed it entirely.It was 3:47 AM on a Tuesday, and she was the only platform engineer on call for Fastlytics, a mid-sized fintech that had grown from twenty engineers to two hundred in eighteen months. Her Pager Duty had been quiet for six hours—unusual, but not impossible. She was half-asleep when the alert came in, but it wasn't the alert she expected.No disk space alarms. No latency spikes. No 5xx error floods.Just a single line in the Cloud Trail logs: Assume Role had been called at 3:42 AM from an IP address in a country where Fastlytics had no employees, no offices, and no customers.

The role was ci-deploy-role-prod—a service account that every build pipeline used to push containers to production.Maya sat up in bed. Her heart started moving before her brain did.She clicked through to the event details. The IP resolved to a small hosting provider known for bulletproof hosting—the kind that ignored abuse complaints. The user agent was not a CI system but a raw Python script. The access key used to call Assume Role belonged to a developer named Alex, who had left the company nine months ago.

His key had never been rotated.She checked the CI/CD audit logs. At 3:41 AM, someone had triggered a build of a rarely-used repository—a weekly reporting job that no one had touched in six months. The build had run for ninety seconds, then stopped. The logs showed something Maya had never seen before: a curl command sending environment variables to an external endpoint. The environment variables included AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_SESSION_TOKEN.The session token was fresh.

Issued at 3:42 AM. The same time as the Assume Role call.Maya understood what had happened, but she couldn't believe it. Someone had used a leaked developer key to assume the CI role, then triggered a malicious pipeline build that exfiltrated the temporary credentials. The attacker now had ci-deploy-role-prod—the same role that could write to production ECR, push to EKS, and read secrets from Parameter Store.She grabbed her phone. Her thumb hovered over the CEO's number.

She didn't call. Instead, she started the "Code Red" playbook she had written six months ago and never tested: revoke the key, isolate the runner, rotate the role, alert the incident response lead.It took her forty-seven minutes. The attacker had access for twenty-three.By the time the incident was contained, the damage was done: thirty-one S3 objects had been downloaded, including a database backup containing customer email addresses and hashed passwords. The attacker had also modified the reporting pipeline permanently—adding a reverse shell that would have activated on the next scheduled run, which was six hours away.Fastlytics survived. The CEO didn't fire Maya.

But the CTO called a meeting the next day with a single question: "How did we not see this coming?"Maya didn't have an answer. But she spent the next six months finding one.This book is that answer.The Castle You Thought You Built For thirty years, enterprise security rested on a simple, comforting assumption: the network perimeter was the boundary of trust. If you could keep attackers outside the firewall, everything inside could be trusted. This model had a name—"castle-and-moat"—and for a long time, it worked well enough. You built high walls (firewalls), dug a deep moat (VPNs, DMZs), and put a drawbridge with guards (authentication, authorization).

The enemies were outside. The good guys were inside. Life was simple.Then three things happened in rapid succession.First, the cloud arrived. Servers that used to sit behind your firewall now sat in AWS, GCP, or Azure. The perimeter became a suggestion, not a boundary.

Second, microservices arrived. Instead of a few monolithic applications running on stable servers, you had hundreds of small services, each with its own network connections, each talking to APIs across the internet. Third, ephemeral infrastructure arrived. Servers no longer lasted months or years. They lasted minutes.

Containers and serverless functions spun up, did their work, and disappeared before a security scan could finish.The castle walls melted. The moat evaporated. The drawbridge became a thousand invisible bridges, each one a connection between a developer's laptop and a cloud API key stored in a CI variable.And somewhere in that transition, the attackers figured something out before most defenders did: the pipeline—the CI/CD system that moves code from developer to production—was the single most valuable target in the entire architecture.The Pipeline as the New Perimeter Consider what a CI/CD system does. It has access to your source code repositories. It has access to your secrets: cloud credentials, database passwords, API keys, signing certificates.

It has access to your build servers, which can run arbitrary code. It has access to your artifact registries, where it pushes containers and binaries. It has access to your production environment, because deploying is its entire purpose.If you were designing a system to be the perfect attacker target, you could not do better than a CI/CD pipeline. It is the single point where every security control converges, where every privilege concentrates, where every blind spot overlaps.This is not hyperbole. It is the conclusion of every major breach investigation from the past five years.Solar Winds (2020): Attackers compromised the build pipeline of a software company, injected a backdoor into a signed, trusted update, and distributed it to eighteen thousand customers—including multiple US government agencies.

The perimeter? Intact. The firewall? Up. The VPN?

In use. None of it mattered because the attacker didn't need to break into the network. They broke into the pipeline.Codecov (2021): Attackers found a credential leak in a Docker image, used it to modify a Bash script that the Codecov uploader pipeline executed on every customer build. Anyone using Codecov to upload test coverage data was potentially compromised. The attack wasn't a sophisticated zero-day.

It was a single credential, poorly stored, giving access to a pipeline that thousands of organizations trusted.Log4Shell (2021): While technically a dependency vulnerability, its impact was amplified by pipelines. The moment the vulnerability was disclosed, attackers scanned Git Hub for any repository with Log4j in its dependencies, then used automated tools to open pull requests that exploited the vulnerability in the pipeline itself—not just the application. The industry learned that dependency scanning cannot happen at release. It must happen at every commit, on every build, on every pull request, because the pipeline is the attack surface.These three events share a common pattern. In each case, the target was not the application.

The target was not the infrastructure. The target was the mechanism that builds and deploys the application and infrastructure. The pipeline.And in each case, the defenders had focused their security efforts elsewhere.The Shift Left Fallacy By now, you have heard the term "shift left" more times than you can count. It appears in every security conference talk, every Dev Ops blog post, every vendor whitepaper. Shift left means moving security activities earlier in the software development lifecycle—testing code…

This is the end of the free sample. Get the eBook to keep going. Buy now

About this book

Review CI/CD pipeline compromise and infrastructure as code risks.

Details

Author
Whaley Destiny
Publisher
SamEnrico
Language
English
Genre
Non-Fiction, Annual Checkup, DevSecOps
Released
2026-06-09
Pages (approx.)
145
Available as
eBook, Audiobook

Read better in the ZLOADR app

Your eBooks on your phone or tablet. Sign in with your SamEnrico account and start reading.

More by Whaley Destiny

See all